Repository navigation
Document Gateway trace context and baggage forwarding - #2659
Open
jirikuncar wants to merge 1 commit into
Open
jirikuncar wants to merge 1 commit into
jirikuncar wants to merge 1 commit into
Conversation
Contributor
jirikuncar
force-pushed
the
docs/gateway-trace-context-baggage
branch
from
October 25, 2026 15:43
1c840ba to
318b4ae
Compare
jirikuncar
marked this pull request as ready for review
October 25, 2026 16:22
Contributor
There was a problem hiding this comment.
1 issue found across 4 files
Confidence score: 5/5
telemetry.mdsays the Gateway reads two headers, but the behavior table also liststracestate. Mentiontracestateas optional in the setup instructions or remove it from the table.
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="docs/reference/advanced/gateway/telemetry.md">
<violation number="1" location="docs/reference/advanced/gateway/telemetry.md:25">
P3: The page says the Gateway reads two headers, but the behavior table also claims it handles `tracestate`. Mention `tracestate` as optional in the setup instructions, or remove it from the table.</violation>
</file>
Tip: Get a Slack DM when cubic finishes reviewing your PRs. Connect Slack
View guided diff | Re-trigger cubic
Add a page that shows how to send traceparent and baggage from an app to the AI Gateway, so the Gateway span joins the app's trace and carries the baggage entries as attributes. Update the Gateway Telemetry section, the navigation manifest, and the Baggage page to link to it.
jirikuncar
force-pushed
the
docs/gateway-trace-context-baggage
branch
from
October 25, 2026 19:01
318b4ae to
8c4d635
Compare
This branch has not been deployed
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.
Summary
Documents the behavior added to the AI Gateway. The Gateway continues the caller's trace from
traceparent, and copiesbaggageentries onto the span it records in the project.docs/reference/advanced/gateway/telemetry.md, "See Gateway requests in your app's trace". It covers prerequisites, a Pydantic AI setup and an OpenAI SDK setup, a verify step with a SQL query, what the Gateway does with each header, and troubleshooting.gateway/index.md: the### Telemetrysection now names the Include messages setting as the UI shows it and links to the new page.navigation.yml: adds the page to the AI Gateway section after "Send Your First Request".baggage.md: one sentence that links to the new page.The page is a new how-to rather than a longer Telemetry section, so the overview stays short and each page does one job.
Validation
uv run pytest tests/test_docs.py tests/test_docs_serve.py: 269 passed. Both Python examples are taggedskip-runwithexternal-connection, as the other Gateway examples are. Two runs reported 2 failures that did not reproduce in five reruns, and I did not capture which tests they were.prek runon the changed files passes.chat gpt-5.2span, in the same trace.user_tier,experiment, and Pydantic AI's owngen_ai.agent.name,gen_ai.agent.call.idandgen_ai.conversation.idappear as attributes on the Gateway span. This works withoutinstrument_httpx, because Pydantic AI'sgateway/provider sends the headers itself.instrument_httpx: the Gateway span is a child of thePOSTspan. Withoutinstrument_httpxit starts a trace of its own.traceparentcarrying the client's trace id, and nobaggageheader.gen_ai.input.messagesis not copied as an attribute. The whole header is still recorded ashttp.request.header.baggage, and the page says so.