Skip to content

Commit

Permalink
fix withspan handler nullable + example (#1377)
Browse files Browse the repository at this point in the history
- class is nullable for pre hooks
- add phpt tests for withspan and its interaction with auto root span
  • Loading branch information
brettmc authored Sep 6, 2024
1 parent e67b49b commit f74cbed
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Instrumentation/WithSpanHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class WithSpanHandler
/**
* @psalm-suppress ArgumentTypeCoercion
*/
public static function pre(mixed $target, array $params, string $class, string $function, ?string $filename, ?int $lineno, ?array $span_args = [], ?array $attributes = []): void
public static function pre(mixed $target, array $params, ?string $class, string $function, ?string $filename, ?int $lineno, ?array $span_args = [], ?array $attributes = []): void
{
static $instrumentation;
$instrumentation ??= new CachedInstrumentation(name: 'io.opentelemetry.php.with-span', schemaUrl: 'https://opentelemetry.io/schemas/1.25.0');
Expand Down

0 comments on commit f74cbed

Please sign in to comment.