Skip to content

fix(langfuse): Prevent LLM span duplication#1077

Open
vprashrex wants to merge 1 commit into
mainfrom
fix/langfuse-otel-tracer-isolation
Open

fix(langfuse): Prevent LLM span duplication#1077
vprashrex wants to merge 1 commit into
mainfrom
fix/langfuse-otel-tracer-isolation

Conversation

@vprashrex

@vprashrex vprashrex commented Jul 24, 2026

Copy link
Copy Markdown
Collaborator

Issue

Closes #1078

Summary

  • Before: LLM spans could duplicate into Sentry.
  • Now: OTel tracer provider is isolated to prevent duplication of spans into Sentry.
  • Isolated the OTel tracer provider.

Checklist

Before submitting a pull request, please ensure that you mark these task.

  • Ran fastapi run --reload app/main.py or docker compose up in the repository root and test.
  • If you've fixed a bug or added code that is tested and has test cases.

Notes

Please add here if any other information is required for the reviewer.

@coderabbitai

coderabbitai Bot commented Jul 24, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@vprashrex, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 50 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: f1bda0d8-a209-4b49-8283-eb4a48701eed

📥 Commits

Reviewing files that changed from the base of the PR and between 49fd4ad and 171dc23.

📒 Files selected for processing (2)
  • backend/app/core/langfuse/langfuse.py
  • backend/app/utils.py
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/langfuse-otel-tracer-isolation

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot changed the title fix(langfuse): isolate OTel tracer provider so LLM spans don't duplicate into Sentry fix(langfuse): Prevent LLM span duplication Jul 24, 2026
@github-actions

Copy link
Copy Markdown

OpenAPI changes   ⚪ No API surface changes

Note

This PR does not modify the API contract.

main332c634d · generated by oasdiff

@vprashrex
vprashrex requested a review from AkhileshNegi July 24, 2026 04:49
@vprashrex vprashrex self-assigned this Jul 24, 2026
@vprashrex vprashrex added bug Something isn't working ready-for-review labels Jul 24, 2026
@codecov

codecov Bot commented Jul 24, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 90.90909% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
backend/app/utils.py 0.00% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working ready-for-review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Langfuse: Reduce Sentry trace duplication

1 participant