docs(integrations): document all sessionId/userId OTel source attributes - #3415
Open
jorgehermo9 wants to merge 1 commit into
Open
docs(integrations): document all sessionId/userId OTel source attributes#3415jorgehermo9 wants to merge 1 commit into
jorgehermo9 wants to merge 1 commit into
Conversation
The OTel attribute mapping table listed only two of the six attributes that ingestion resolves for sessionId, omitting the GenAI semantic convention gen_ai.conversation.id (supported since v3.79.1) along with the langfuse metadata and Vercel AI SDK fallbacks. Same gap for userId. Also documents that multiple source attributes resolve first-match-wins, which is what makes session.id take precedence over gen_ai.conversation.id when a span carries both. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FfN1RMd58pEnDLzbNsPmSJ
|
@jorgehermo9 is attempting to deploy a commit to the langfuse Team on Vercel. A member of the Team first needs to authorize it. |
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.
Problem
The OTel attribute mapping table does not document
gen_ai.conversation.id, even though Langfuse has mapped it tosessionIdsince v3.79.1 (added in langfuse/langfuse#7738, commitc2a0b381d). The same table also omits thelangfuse.*.metadata.langfuse_{user,session}_idandai.telemetry.metadata.{userId,sessionId}fallbacks that ingestion accepts.extractSessionIdinpackages/shared/src/server/otel/OtelIngestionProcessor.tsresolves six keys, of which the table lists two:extractUserIdhas the same shape foruserId.This is the one row where a GenAI semantic-convention attribute applies, and the section states that "Langfuse aims to be compliant with the OpenTelemetry GenAI semantic conventions" while the observation-level table lists
gen_ai.*fallbacks generously. Frameworks that emitgen_ai.conversation.idand nothing else (Koog, Microsoft Agent Framework — both present in the repo's own trace fixtures) already get sessions for free, but users reading the docs will not know that and will add a redundantsession.id.Because
content/**feeds the HTML page, the.mdvariant (scripts/copy_md_sources.js→public/md-src/**),llms.txt(scripts/generate_llms_txt.js), and the docs MCP corpus, the omission is currently reproduced on every surface an agent might read.Changes
userIdandsessionIdrows of the trace-level mapping table, listed in the order ingestion resolves them.langfuse.*namespace takes precedence over generic OTel conventions, but not how two generic conventions rank against each other — relevant becausesession.idsilently wins overgen_ai.conversation.idwhen both are present (asserted inotelMapping.servertest.ts).gen_ai.conversation.idin the attribute-propagation list, which had the same two-key gap.No behaviour change; this documents what already ships.
Notes
prettier@3.8.3with the repo's.prettierrc.json, sopnpm run format:checkpasses.OtelIngestionProcessor.ts.Question for maintainers
Out of scope here, but worth a decision: should
gen_ai.conversation.idrank abovesession.idnow that the GenAI convention is stable, and should the Python/JS SDKs emit it alongsidesession.id? Currently neither SDK emits it (TRACE_SESSION_ID = "session.id"in both), so spans exported to a non-Langfuse backend carry no GenAI conversation attribute. Happy to open a discussion instead if you prefer.🤖 Generated with Claude Code
Greptile Summary
Updates the OpenTelemetry integration documentation to:
userIdandsessionIdsource attributes.gen_ai.conversation.idin the trace attribute-propagation guidance.Confidence Score: 5/5
The documentation-only change appears safe to merge.
The updated MDX uses ordinary Markdown constructs supported by the existing content pipeline, and no incorrect, broken, or internally inconsistent changed behavior was established.
Reviews (1): Last reviewed commit: "docs(integrations): document all session..." | Re-trigger Greptile
Context used: