Repository navigation
fix(telemetry): extract W3C traceparent/baggage when AE header is absent - #7846
Closed
ninglinLiu wants to merge 14 commits into
Closed
ninglinLiu wants to merge 14 commits into
ninglinLiu wants to merge 14 commits into
Conversation
Fixes google#7844. get_propagated_context only joined traces via Google-Agent-Engine-Traceparent. Extract standard W3C traceparent/tracestate when that header is missing, and extract W3C baggage without letting callers clobber internal baggage keys. Agent Engine parent still wins when both headers are present. This PR was prepared with AI assistance and reviewed/tested by the author.
Collaborator
|
thanks for sending this in first, @ninglinLiu. f27b8f1 fixes the same issue on main: fastapi requests now read standard w3c traceparent, tracestate and baggage headers when the agent engine header is absent, and your three new tests pass against main. it's on main now and not in a release yet. please open a new issue if you still see this happening. |
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.
Description
Fixes #7844
get_propagated_context()only extractedGoogle-Agent-Engine-Traceparentfor the parent span context. A standard W3Ctraceparentwas stored only as the support-ID baggage value, soadk api_server/adk webstarted a new trace for ordinary callers. Inbound W3Cbaggagewas ignored.This change:
traceparent/tracestatewhen the Agent Engine header is absent, so ADK spans join the caller's trace.baggage, then re-applies internalgoogle_traceparent/traceparentkeys so callers cannot clobber them.Testing
pytest tests/unittests/telemetry/test_agent_engine.py— 43 passedThis PR was prepared with AI assistance and reviewed/tested by the author.