Repository navigation
fix(otel): preserve Langfuse deployment metadata - #47912
Closed
libaojiang wants to merge 4 commits into
Closed
libaojiang wants to merge 4 commits into
libaojiang wants to merge 4 commits into
Conversation
Contributor
Merging this PR will not alter performance1 warning
Comparing Footnotes |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
libaojiang
force-pushed
the
fix-langfuse-trace-metadata-47898
branch
from
November 4, 2026 07:44
4db334b to
3b69236
Compare
Contributor
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.
OTel v2 now forwards Langfuse environment, release and version on root and generation spans. Request headers take precedence over metadata, and the tracing environment falls back to LANGFUSE_TRACING_ENVIRONMENT. Operators can selectively allow these request parameters across all models
Details
TLDR
Problem this solves:
How it solves it:
User Flow
Before, an application loses its deployment labels in Langfuse
After, the requested deployment labels reach the exported spans
Relevant issues
Fixes #47898
The report and proposed patches come from @Praveena-617
Configuration
Headers langfuse_environment, langfuse_release and langfuse_version override metadata.langfuse_environment, metadata.trace_release and metadata.trace_version. The same metadata names work through litellm_metadata for Messages requests. Unlisted parameters remain rejected, and server-owned identity fields retain their unconditional checks
Pre-Submission checklist
Validation
The 885 OTEL, mapper and authentication tests were recorded at 4db334b
Changed Python files parse, import-order checks pass and scoped type-discipline counts do not grow. Fresh runtime tests cannot collect locally because the new main requires the compiled Rust bridge, which is unavailable in this Windows environment. Latest GitHub Actions runs require maintainer approval before execution, and fresh CI and CLA results remain pending
The merge retains main's new request-metadata mapping and adds the three deployment attributes to its destination-filter inventory. The dashboard type addition preserves main's separate input and output components. Full type regeneration and real Langfuse ingestion remain pending
Type
Bug fix
Caveats
Medium
This remains a draft until actual provider calls and Langfuse observation reads can be recorded. Unit tests verify emitted attributes and parameter admission, and do not establish acceptance by a hosted Langfuse service
Dependency follow-up
Synchronized with main at 527d882, which already includes #48302. This PR has no manifest, lockfile, OSV policy or workflow changes relative to main
Removed the obsolete merge ancestry that introduced an unsigned committer. Original feature commits are retained, and the previous head is backed up on the fork
Screenshots / Proof of Fix
Real-service proof remains pending, so this PR stays a draft. Earlier unit results at 4db334b are historical evidence and do not establish runtime success at current tip 3b69236