-
Notifications
You must be signed in to change notification settings - Fork 197
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
use _register.php to register SPI classes
in most cases, we can use existing _register.php files rather than using config.spi - this removes some repetition, and means the experience without SPI plugin enabled should be closer to when it is enabled. Merge 3x different _register.php's from SDK into one at the top level.
- Loading branch information
Showing
11 changed files
with
106 additions
and
103 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
use Nevay\SPI\ServiceLoader; | ||
use OpenTelemetry\Config\SDK\ComponentProvider\Instrumentation\General\HttpConfigProvider; | ||
use OpenTelemetry\Config\SDK\ComponentProvider\Instrumentation\General\PeerConfigProvider; | ||
use OpenTelemetry\Config\SDK\ComponentProvider\Logs\LogRecordExporterConsole; | ||
use OpenTelemetry\Config\SDK\ComponentProvider\Logs\LogRecordExporterOtlp; | ||
use OpenTelemetry\Config\SDK\ComponentProvider\Logs\LogRecordProcessorBatch; | ||
use OpenTelemetry\Config\SDK\ComponentProvider\Logs\LogRecordProcessorSimple; | ||
use OpenTelemetry\Config\SDK\ComponentProvider\Metrics\AggregationResolverDefault; | ||
use OpenTelemetry\Config\SDK\ComponentProvider\Metrics\MetricExporterConsole; | ||
use OpenTelemetry\Config\SDK\ComponentProvider\Metrics\MetricExporterOtlp; | ||
use OpenTelemetry\Config\SDK\ComponentProvider\Metrics\MetricReaderPeriodic; | ||
use OpenTelemetry\Config\SDK\ComponentProvider\Propagator\TextMapPropagatorB3; | ||
use OpenTelemetry\Config\SDK\ComponentProvider\Propagator\TextMapPropagatorB3Multi; | ||
use OpenTelemetry\Config\SDK\ComponentProvider\Propagator\TextMapPropagatorBaggage; | ||
use OpenTelemetry\Config\SDK\ComponentProvider\Propagator\TextMapPropagatorComposite; | ||
use OpenTelemetry\Config\SDK\ComponentProvider\Propagator\TextMapPropagatorJaeger; | ||
use OpenTelemetry\Config\SDK\ComponentProvider\Propagator\TextMapPropagatorTraceContext; | ||
use OpenTelemetry\Config\SDK\ComponentProvider\Trace\SamplerAlwaysOff; | ||
use OpenTelemetry\Config\SDK\ComponentProvider\Trace\SamplerAlwaysOn; | ||
use OpenTelemetry\Config\SDK\ComponentProvider\Trace\SamplerParentBased; | ||
use OpenTelemetry\Config\SDK\ComponentProvider\Trace\SamplerTraceIdRatioBased; | ||
use OpenTelemetry\Config\SDK\ComponentProvider\Trace\SpanExporterConsole; | ||
use OpenTelemetry\Config\SDK\ComponentProvider\Trace\SpanExporterOtlp; | ||
use OpenTelemetry\Config\SDK\ComponentProvider\Trace\SpanExporterZipkin; | ||
use OpenTelemetry\Config\SDK\ComponentProvider\Trace\SpanProcessorBatch; | ||
use OpenTelemetry\Config\SDK\ComponentProvider\Trace\SpanProcessorSimple; | ||
use OpenTelemetry\Config\SDK\Configuration\ComponentProvider; | ||
|
||
ServiceLoader::register(ComponentProvider::class, TextMapPropagatorB3::class); | ||
ServiceLoader::register(ComponentProvider::class, TextMapPropagatorB3Multi::class); | ||
ServiceLoader::register(ComponentProvider::class, TextMapPropagatorBaggage::class); | ||
ServiceLoader::register(ComponentProvider::class, TextMapPropagatorComposite::class); | ||
ServiceLoader::register(ComponentProvider::class, TextMapPropagatorJaeger::class); | ||
ServiceLoader::register(ComponentProvider::class, TextMapPropagatorTraceContext::class); | ||
|
||
ServiceLoader::register(ComponentProvider::class, SamplerAlwaysOff::class); | ||
ServiceLoader::register(ComponentProvider::class, SamplerAlwaysOn::class); | ||
ServiceLoader::register(ComponentProvider::class, SamplerParentBased::class); | ||
ServiceLoader::register(ComponentProvider::class, SamplerTraceIdRatioBased::class); | ||
|
||
ServiceLoader::register(ComponentProvider::class, SpanExporterConsole::class); | ||
ServiceLoader::register(ComponentProvider::class, SpanExporterOtlp::class); | ||
ServiceLoader::register(ComponentProvider::class, SpanExporterZipkin::class); | ||
ServiceLoader::register(ComponentProvider::class, SpanProcessorBatch::class); | ||
ServiceLoader::register(ComponentProvider::class, SpanProcessorSimple::class); | ||
|
||
ServiceLoader::register(ComponentProvider::class, AggregationResolverDefault::class); | ||
ServiceLoader::register(ComponentProvider::class, MetricExporterConsole::class); | ||
ServiceLoader::register(ComponentProvider::class, MetricExporterOtlp::class); | ||
ServiceLoader::register(ComponentProvider::class, MetricReaderPeriodic::class); | ||
|
||
ServiceLoader::register(ComponentProvider::class, LogRecordExporterConsole::class); | ||
ServiceLoader::register(ComponentProvider::class, LogRecordExporterOtlp::class); | ||
ServiceLoader::register(ComponentProvider::class, LogRecordProcessorBatch::class); | ||
ServiceLoader::register(ComponentProvider::class, LogRecordProcessorSimple::class); | ||
|
||
ServiceLoader::register(ComponentProvider::class, HttpConfigProvider::class); | ||
ServiceLoader::register(ComponentProvider::class, PeerConfigProvider::class); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
use Nevay\SPI\ServiceLoader; | ||
use OpenTelemetry\SDK\Common\Export\Http\PsrTransportFactory; | ||
use OpenTelemetry\SDK\Common\Export\Stream\StreamTransportFactory; | ||
use OpenTelemetry\SDK\Common\Export\TransportFactoryInterface; | ||
use OpenTelemetry\SDK\Logs\Exporter as LogsExporter; | ||
use OpenTelemetry\SDK\Logs\LogRecordExporterFactoryInterface; | ||
use OpenTelemetry\SDK\Metrics\MetricExporter; | ||
use OpenTelemetry\SDK\Metrics\MetricExporterFactoryInterface; | ||
use OpenTelemetry\SDK\Trace\SpanExporter; | ||
use OpenTelemetry\SDK\Trace\SpanExporter\SpanExporterFactoryInterface; | ||
|
||
ServiceLoader::register(LogRecordExporterFactoryInterface::class, LogsExporter\ConsoleExporterFactory::class); | ||
ServiceLoader::register(LogRecordExporterFactoryInterface::class, LogsExporter\InMemoryExporterFactory::class); | ||
|
||
ServiceLoader::register(MetricExporterFactoryInterface::class, MetricExporter\InMemoryExporterFactory::class); | ||
ServiceLoader::register(MetricExporterFactoryInterface::class, MetricExporter\ConsoleMetricExporterFactory::class); | ||
ServiceLoader::register(MetricExporterFactoryInterface::class, MetricExporter\NoopMetricExporterFactory::class); | ||
|
||
ServiceLoader::register(SpanExporterFactoryInterface::class, SpanExporter\ConsoleSpanExporterFactory::class); | ||
ServiceLoader::register(SpanExporterFactoryInterface::class, SpanExporter\InMemorySpanExporterFactory::class); | ||
|
||
ServiceLoader::register(TransportFactoryInterface::class, StreamTransportFactory::class); | ||
ServiceLoader::register(TransportFactoryInterface::class, PsrTransportFactory::class); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters