diff --git a/deptrac.baseline.yaml b/deptrac.baseline.yaml index ebcd48726..cacb15fb7 100644 --- a/deptrac.baseline.yaml +++ b/deptrac.baseline.yaml @@ -1,2 +1,8 @@ deptrac: skip_violations: + /src/Extension/Propagator/B3/_register.php: + - OpenTelemetry\SDK\Registry + /src/Extension/Propagator/CloudTrace/_register.php: + - OpenTelemetry\SDK\Registry + /src/Extension/Propagator/Jaeger/_register.php: + - OpenTelemetry\SDK\Registry diff --git a/deptrac.yaml b/deptrac.yaml index f7e21785d..8507328db 100644 --- a/deptrac.yaml +++ b/deptrac.yaml @@ -19,34 +19,32 @@ deptrac: layers: - name: API collectors: - - type: className - regex: ^OpenTelemetry\\API\\* + - type: directory + value: src/API/.* - name: SDK collectors: - - type: className - regex: ^OpenTelemetry\\SDK\\* + - type: directory + value: src/SDK/.* - name: Context collectors: - - type: className - regex: ^OpenTelemetry\\Context\\* + - type: directory + value: src/Context/.* - name: SemConv collectors: - - type: className - regex: ^OpenTelemetry\\SemConv\\* + - type: directory + value: src/SemConv/.* - name: Contrib collectors: - - type: className - regex: ^OpenTelemetry\\Contrib\\* + - type: directory + value: src/Contrib/.* - name: Extension collectors: - - type: className - regex: ^OpenTelemetry\\Extension\\* + - type: directory + value: src/Extension/.* - name: OtelProto collectors: - - type: className - regex: ^OpenTelemetry\\Proto\\* - - type: className - regex: ^GPBMetadata\\Opentelemetry\\* + - type: directory + value: proto/otel/.* - name: GoogleProtobuf collectors: - type: className diff --git a/src/Extension/Propagator/B3/_register.php b/src/Extension/Propagator/B3/_register.php index 7537e8fc4..72e30cee0 100644 --- a/src/Extension/Propagator/B3/_register.php +++ b/src/Extension/Propagator/B3/_register.php @@ -3,14 +3,17 @@ declare(strict_types=1); use OpenTelemetry\Extension\Propagator\B3\B3Propagator; -use OpenTelemetry\SDK\Common\Configuration\KnownValues; use OpenTelemetry\SDK\Registry; +if (!class_exists(Registry::class)) { + return; +} + Registry::registerTextMapPropagator( - KnownValues::VALUE_B3, + 'b3', B3Propagator::getB3SingleHeaderInstance() ); Registry::registerTextMapPropagator( - KnownValues::VALUE_B3_MULTI, + 'b3multi', B3Propagator::getB3MultiHeaderInstance() ); diff --git a/src/Extension/Propagator/CloudTrace/_register.php b/src/Extension/Propagator/CloudTrace/_register.php index 0643f389c..5fcac7243 100644 --- a/src/Extension/Propagator/CloudTrace/_register.php +++ b/src/Extension/Propagator/CloudTrace/_register.php @@ -3,15 +3,18 @@ declare(strict_types=1); use OpenTelemetry\Extension\Propagator\CloudTrace\CloudTracePropagator; -use OpenTelemetry\SDK\Common\Configuration\KnownValues; use OpenTelemetry\SDK\Registry; +if (!class_exists(Registry::class)) { + return; +} + Registry::registerTextMapPropagator( - KnownValues::VALUE_CLOUD_TRACE, + 'cloudtrace', CloudTracePropagator::getInstance() ); Registry::registerTextMapPropagator( - KnownValues::VALUE_CLOUD_TRACE_ONEWAY, + 'cloudtrace-oneway', CloudTracePropagator::getOneWayInstance() ); diff --git a/src/Extension/Propagator/Jaeger/_register.php b/src/Extension/Propagator/Jaeger/_register.php index edad7b5b1..f1b7eb2c6 100644 --- a/src/Extension/Propagator/Jaeger/_register.php +++ b/src/Extension/Propagator/Jaeger/_register.php @@ -4,15 +4,18 @@ use OpenTelemetry\Extension\Propagator\Jaeger\JaegerBaggagePropagator; use OpenTelemetry\Extension\Propagator\Jaeger\JaegerPropagator; -use OpenTelemetry\SDK\Common\Configuration\KnownValues; use OpenTelemetry\SDK\Registry; +if (!class_exists(Registry::class)) { + return; +} + Registry::registerTextMapPropagator( - KnownValues::VALUE_JAEGER, + 'jaeger', JaegerPropagator::getInstance() ); Registry::registerTextMapPropagator( - KnownValues::VALUE_JAEGER_BAGGAGE, + 'jaeger-baggage', JaegerBaggagePropagator::getInstance() );