diff options
author | Andrew Dolgov <[email protected]> | 2023-10-21 10:02:49 +0300 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2023-10-21 10:02:49 +0300 |
commit | 93bb473bceb3f4c6450f3101fa82a17dc84cf388 (patch) | |
tree | 758c01ca255e8c4e2f56802bb8f36cad3a7410c9 /classes/tracer.php | |
parent | 6e025103d31760b5e1d6e49fe3d6685207641a4a (diff) |
make phpstan happy, run phpstan on all files on task startupprotected/opentelemetry
Diffstat (limited to 'classes/tracer.php')
-rw-r--r-- | classes/tracer.php | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/classes/tracer.php b/classes/tracer.php index e8f6a0378..0e72e7976 100644 --- a/classes/tracer.php +++ b/classes/tracer.php @@ -1,25 +1,25 @@ <?php -use OpenTelemetry\Contrib\Otlp\OtlpHttpTransportFactory; -use OpenTelemetry\Contrib\Otlp\SpanExporter; -use OpenTelemetry\SDK\Trace\SpanProcessor\SimpleSpanProcessor; -use OpenTelemetry\SDK\Trace\TracerProvider; + use OpenTelemetry\API\Trace\Propagation\TraceContextPropagator; use OpenTelemetry\API\Trace\SpanKind; -use OpenTelemetry\SDK\Trace\SpanExporter\InMemoryExporter; - -use OpenTelemetry\SDK\Resource\ResourceInfoFactory; -use OpenTelemetry\SDK\Resource\ResourceInfo; +use OpenTelemetry\Contrib\Otlp\OtlpHttpTransportFactory; +use OpenTelemetry\Contrib\Otlp\SpanExporter; use OpenTelemetry\SDK\Common\Attribute\Attributes; -use OpenTelemetry\SemConv\ResourceAttributes; +use OpenTelemetry\SDK\Resource\ResourceInfo; +use OpenTelemetry\SDK\Resource\ResourceInfoFactory; use OpenTelemetry\SDK\Trace\Sampler\AlwaysOnSampler; use OpenTelemetry\SDK\Trace\Sampler\ParentBased; - +use OpenTelemetry\SDK\Trace\SpanExporter\InMemoryExporter; +use OpenTelemetry\SDK\Trace\SpanProcessor\SimpleSpanProcessor; +use OpenTelemetry\SDK\Trace\TracerProvider; +use OpenTelemetry\SemConv\ResourceAttributes; class Tracer { /** @var Tracer $instance */ private static $instance; + /** @var OpenTelemetry\SDK\Trace\TracerProviderInterface $tracerProvider */ private $tracerProvider; /** @var OpenTelemetry\API\Trace\TracerInterface $tracer */ @@ -56,6 +56,7 @@ class Tracer { ->setSpanKind(SpanKind::KIND_SERVER) ->setAttribute('php.request', json_encode($_REQUEST)) ->setAttribute('php.server', json_encode($_SERVER)) + ->setAttribute('php.session', json_encode($_SESSION)) ->startSpan(); $scope = $span->activate(); |