@@ -34,7 +34,7 @@ public static function register(): void
3434 hook (
3535 Transaction::class,
3636 'send ' ,
37- pre: static function (Transaction $ transaction , array $ params , string $ class , string $ function , ?string $ filename , ?int $ lineno ) use ($ instrumentation ): ? array {
37+ pre: static function (Transaction $ transaction , array $ params , string $ class , string $ function , ?string $ filename , ?int $ lineno ) use ($ instrumentation ): array {
3838 $ request = $ params [0 ];
3939
4040 $ propagator = Globals::propagator ();
@@ -44,11 +44,10 @@ public static function register(): void
4444 $ request = $ request ->withoutHeader ($ field );
4545 }
4646
47- /** @psalm-suppress ArgumentTypeCoercion */
4847 $ spanBuilder = $ instrumentation
4948 ->tracer ()
5049 // https://opentelemetry.io/docs/specs/semconv/http/http-spans/#http-client-span
51- ->spanBuilder (sprintf ('%s ' , $ request ->getMethod ()))
50+ ->spanBuilder (sprintf ('%s ' , $ request ->getMethod ()) ?: ' HTTP ' )
5251 ->setParent ($ parentContext )
5352 ->setSpanKind (SpanKind::KIND_CLIENT )
5453 ->setAttribute (TraceAttributes::HTTP_REQUEST_METHOD , $ request ->getMethod ())
@@ -88,6 +87,7 @@ public static function register(): void
8887
8988 return [$ request ];
9089 },
90+ /** @psalm-suppress UnusedClosureParam */
9191 post: static function (Transaction $ transaction , array $ params , PromiseInterface $ promise , ?Throwable $ exception ): PromiseInterface {
9292 $ scope = Context::storage ()->scope ();
9393 $ scope ?->detach();
@@ -111,7 +111,6 @@ public static function register(): void
111111 // @codeCoverageIgnoreStart
112112 foreach ((array ) (get_cfg_var ('otel.instrumentation.http.response_headers ' ) ?: []) as $ header ) {
113113 if ($ response ->hasHeader ($ header )) {
114- /** @psalm-suppress ArgumentTypeCoercion */
115114 $ span ->setAttribute (
116115 sprintf ('%s.%s ' , TraceAttributes::HTTP_RESPONSE_HEADER , strtolower ($ header )),
117116 $ response ->getHeaderLine ($ header )
@@ -136,7 +135,6 @@ public static function register(): void
136135 // @codeCoverageIgnoreStart
137136 foreach ((array ) (get_cfg_var ('otel.instrumentation.http.response_headers ' ) ?: []) as $ header ) {
138137 if ($ t ->getResponse ()->hasHeader ($ header )) {
139- /** @psalm-suppress ArgumentTypeCoercion */
140138 $ span ->setAttribute (
141139 sprintf ('%s.%s ' , TraceAttributes::HTTP_RESPONSE_HEADER , strtolower ($ header )),
142140 $ t ->getResponse ()->getHeaderLine ($ header )
0 commit comments