This repository was archived by the owner on Dec 5, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed
Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change 1818 "php" : " >=8.2" ,
1919 "open-telemetry/sdk" : " *" ,
2020 "open-telemetry/exporter-otlp" : " *" ,
21- "ext-opentelemetry" : " *"
21+ "ext-opentelemetry" : " *" ,
22+ "open-telemetry/opentelemetry-auto-laravel" : " ^0.0.25"
2223 },
2324 "require-dev" : {
2425 "orchestra/testbench" : " ^9.0" ,
Original file line number Diff line number Diff line change 22
33namespace Overtrue \LaravelOpenTelemetry \Support ;
44
5+ use Closure ;
56use Illuminate \Contracts \Foundation \Application ;
67use OpenTelemetry \API \Globals ;
78use OpenTelemetry \API \Trace \Propagation \TraceContextPropagator ;
1213use OpenTelemetry \Context \ContextInterface ;
1314use OpenTelemetry \Context \Propagation \TextMapPropagatorInterface ;
1415use OpenTelemetry \Context \ScopeInterface ;
16+ use OpenTelemetry \SDK \Propagation \PropagatorFactory ;
17+ use OpenTelemetry \SDK \Registry ;
1518
1619class Measure
1720{
@@ -30,7 +33,7 @@ public function span(string $name): SpanBuilder
3033 return new SpanBuilder ($ this ->tracer ()->spanBuilder ($ name ));
3134 }
3235
33- public function start (string |int $ name , ?\ Closure $ callback = null ): StartedSpan
36+ public function start (string |int $ name , ?Closure $ callback = null ): StartedSpan
3437 {
3538 $ name = (string ) $ name ;
3639 $ spanBuilder = $ this ->span ($ name );
@@ -87,7 +90,7 @@ public function traceId(): ?string
8790
8891 public function propagator ()
8992 {
90- return $ this -> app -> get (TextMapPropagatorInterface::class) ?? TraceContextPropagator:: getInstance ();
93+ return ( new PropagatorFactory ())-> create ();
9194 }
9295
9396 public function propagationHeaders (?ContextInterface $ context = null ): array
You can’t perform that action at this time.
0 commit comments