Repository navigation
feat(telemetry): record the trusted user as user.id - #3552
Merged
Merged
Conversation
Signed-off-by: krisztianfekete <git@krisztianfekete.org>
krisztianfekete
marked this pull request as ready for review
November 6, 2026 11:19
krisztianfekete
requested review from
a team and
supreme-gg-gg
as code owners
November 6, 2026 11:19
adalundhe
approved these changes
Nov 6, 2026
EItanya
approved these changes
Nov 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
The runtimes now record the gateway-forwarded user (
x-user-id) asuser.idinstead ofenduser.id, on the request span and the spans beneath it. Go ADK and the Python runtimes change together, and the registry, policy, live-check rule and docs follow.Why
Semantic conventions v1.45.0 deprecated
enduser.idandenduser.pseudo.idand moved them to the client-side conventions (open-telemetry/semantic-conventions#4238), which cover browsers and mobile apps. For a server, the attribute is the coreuser.id. It already exists in the pinned v1.44.0 registry and in the Gosemconv/v1.43.0package, so this PR needs no dependency or pin bump. The core v1.45.0 and GenAI pin bump comes in a follow-up.Breaking change
This is a hard rename. Queries, dashboards and access rules that read
enduser.idmust readuser.id. To keep the old name for one release, add this to an OpenTelemetry Collectortransformprocessor:Claude Code spans carry their own
user.id, which is a hash of the Claude account and not the kagent user. Read the trusted user from the invocation span.Notes
kagent.requestnow finds request spans bya2a.methodinstead of the user attribute. Otherwise Claude Code's nativeuser.idwould match its spans against the kagent request group.user.idshould land before this PR is synced into their tree.Testing
make semconv-check semconv-policies-test semconv-generatego test ./pkg/tracing/... ./adk/pkg/a2a/... ./adk/pkg/telemetry/...uv run pytest packages/kagent-core/tests/test_a2a_telemetry.py