Skip to content

Commit 48c7062

Browse files
MilanGarnierclaude
andcommitted
Tag manual OTel span with request user-agent for rid correlation
get_spans_list filters spans by matching the request rid embedded in http.useragent; the manually-created OTel span didn't carry that tag, so it was invisible to test assertions once OTel bridging is enabled. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
1 parent 5edaf2c commit 48c7062

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

utils/build/docker/php/common/otel_drop_in_extract_and_make_distant_call.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
->setParent($context)
2626
->setSpanKind(\OpenTelemetry\API\Trace\SpanKind::KIND_SERVER)
2727
->startSpan();
28+
$span->setAttribute('http.useragent', $_SERVER['HTTP_USER_AGENT'] ?? '');
2829
$scope = $span->activate();
2930

3031
// Make the distant call; auto-instrumentation propagates the active span context.

0 commit comments

Comments
 (0)