Skip to content

docs: add attribute propagation guidance to OpenTelemetry integration#2271

Merged
Steffen911 merged 2 commits intomainfrom
steffen/lfe-7505-otel-attribute-propagation
Nov 11, 2025
Merged

docs: add attribute propagation guidance to OpenTelemetry integration#2271
Steffen911 merged 2 commits intomainfrom
steffen/lfe-7505-otel-attribute-propagation

Conversation

@Steffen911
Copy link
Copy Markdown
Member

@Steffen911 Steffen911 commented Nov 7, 2025

Summary

Extends the OpenTelemetry integration documentation to include comprehensive guidance on attribute propagation for trace-level attributes. This documentation builds on the work from #2240 where similar guidance was added to the Python and JS SDK docs.

Changes

Added a new subsection "Propagating Trace Attributes to All Spans" within the Property Mapping section (pages/integrations/native/opentelemetry.mdx) that covers:

  • Why propagation is needed: Explains that userId, sessionId, metadata, version, release, and tags should be propagated to all spans for accurate filtering and aggregations in future Langfuse versions
  • Recommended approach: Details using OpenTelemetry Baggage with BaggageSpanProcessor as the primary method for users not using Langfuse SDKs
  • Security considerations: Prominent warning about baggage propagating to third-party services and avoiding sensitive data
  • Alternative option: References Langfuse SDK v3's propagate_attributes() methods for users of the SDK
  • Future compatibility: Positions as "strongly recommended now" without specifying hard transition date

Context

This addresses the need to communicate the upcoming change where Langfuse aggregations will operate on individual observations rather than just trace-level data. The OpenTelemetry integration doc is specifically for users who are not using the Langfuse SDKs directly, so the focus is on native OpenTelemetry patterns (baggage) rather than SDK-specific methods.

Related

🤖 Generated with Claude Code


Important

Adds guidance on propagating trace-level attributes to all spans in OpenTelemetry integration docs for future Langfuse compatibility.

  • Documentation Update:
    • Adds "Propagating Trace Attributes to All Spans" subsection in opentelemetry.mdx.
    • Explains the need for propagating userId, sessionId, metadata, version, release, and tags to all spans for future Langfuse compatibility.
    • Recommends using OpenTelemetry Baggage with BaggageSpanProcessor for propagation.
    • Warns against including sensitive data in baggage due to third-party propagation.
    • Mentions Langfuse SDK v3's propagate_attributes() as an alternative for SDK users.

This description was created by Ellipsis for 5a87297. You can customize this summary. It will automatically update as commits are pushed.

Add comprehensive documentation on propagating trace-level attributes (userId, sessionId, metadata, version, release, tags) to all spans within OpenTelemetry traces. This ensures compatibility with future Langfuse versions where aggregations will operate on individual observations.

Key additions:
- Explain why attribute propagation is needed for accurate filtering and aggregations
- Recommend OpenTelemetry Baggage with BaggageSpanProcessor as primary approach
- Include security warning about baggage propagation to third-party services
- Reference Langfuse SDK v3 convenience methods as alternative
- Position as recommended now for future compatibility

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@dosubot dosubot Bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Nov 7, 2025
@vercel
Copy link
Copy Markdown

vercel Bot commented Nov 7, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Updated (UTC)
langfuse-docs Ready Ready Preview Nov 11, 2025 8:57am

@dosubot dosubot Bot added the documentation Improvements or additions to documentation label Nov 7, 2025
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Nov 7, 2025

📦 Next.js Bundle Analysis for langfuse-docs

This analysis was generated by the Next.js Bundle Analysis action. 🤖

One Page Changed Size

The following page changed size from the code in this PR compared to its base branch:

Page Size (compressed) First Load % of Budget (350 KB)
/integrations/native/opentelemetry 62.67 KB 459.02 KB 131.15% (🟡 +0.29%)
Details

Only the gzipped size is provided here based on an expert tip.

First Load is the size of the global bundle plus the bundle for the individual page. If a user were to show up to your website and land on a given page, the first load size represents the amount of javascript that user would need to download. If next/link is used, subsequent page loads would only need to download that page's bundle (the number in the "Size" column), since the global bundle has already been downloaded.

Any third party scripts you have added directly to your app using the <script> tag are not accounted for in this analysis

The "Budget %" column shows what percentage of your performance budget the First Load total takes up. For example, if your budget was 100kb, and a given page's first load size was 10kb, it would be 10% of your budget. You can also see how much this has increased or decreased compared to the base branch of your PR. If this percentage has increased by 20% or more, there will be a red status indicator applied, indicating that special attention should be given to this. If you see "+/- <0.01%" it means that there was a change in bundle size, but it is a trivial enough amount that it can be ignored.

@dosubot dosubot Bot added the lgtm This PR has been approved by a maintainer label Nov 11, 2025
@Steffen911 Steffen911 added this pull request to the merge queue Nov 11, 2025
@dosubot dosubot Bot added the auto-merge This PR is set to be merged label Nov 11, 2025
Merged via the queue into main with commit e8b421b Nov 11, 2025
12 checks passed
@Steffen911 Steffen911 deleted the steffen/lfe-7505-otel-attribute-propagation branch November 11, 2025 09:27
@dosubot dosubot Bot removed the auto-merge This PR is set to be merged label Nov 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation lgtm This PR has been approved by a maintainer size:M This PR changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants