Skip to content

feat(telemetry): add OpenTelemetry support for request-to-token attri…#65

Merged
JustAGhosT merged 1 commit intodevfrom
feat/request-to-token-attribution
Mar 15, 2026
Merged

feat(telemetry): add OpenTelemetry support for request-to-token attri…#65
JustAGhosT merged 1 commit intodevfrom
feat/request-to-token-attribution

Conversation

@JustAGhosT
Copy link
Copy Markdown
Contributor

@JustAGhosT JustAGhosT commented Mar 15, 2026

…bution

  • Add otel callback to LiteLLM success/failure callbacks
  • Add OTEL env vars: OTEL_SERVICE_NAME, OTEL_TRACER_NAME, OTEL_EXPORTER_OTLP_ENDPOINT
  • Add new variables: otel_exporter_endpoint, otel_service_name
  • Update planning doc with implementation details and upstream requirements

Pull Request Checklist

Summary

  • What changed?
  • Why was it needed?

Validation

  • Local checks run (if applicable)
  • Relevant workflow/jobs observed

Deployment Notes

  • No environment/config changes required
  • Environment/config changes required (describe below)

UAT Toggle (PRs to main)

  • Add label run-uat to this PR to enable UAT deployment (deploy-uat).
  • Remove label run-uat to skip UAT deployment.

Risk / Rollback

  • Risk level: low / medium / high
  • Rollback plan:

Summary by CodeRabbit

Release Notes

  • New Features

    • Integrated OpenTelemetry for comprehensive token telemetry and observability, capturing metrics including model, provider, deployment, and token counts.
    • Added configurable correlation-ID propagation methods for enhanced request tracking across services.
  • Documentation

    • Updated architecture planning with OpenTelemetry integration strategy, implementation options, and refined event shapes for downstream analytics.

…bution

- Add otel callback to LiteLLM success/failure callbacks
- Add OTEL env vars: OTEL_SERVICE_NAME, OTEL_TRACER_NAME, OTEL_EXPORTER_OTLP_ENDPOINT
- Add new variables: otel_exporter_endpoint, otel_service_name
- Update planning doc with implementation details and upstream requirements
@chatgpt-codex-connector
Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 15, 2026

Caution

Review failed

Pull request was closed or merged during review

📝 Walkthrough

Walkthrough

The pull request transitions the AI Gateway's tracing infrastructure from Langfuse to OpenTelemetry. This involves updating the planning documentation to reflect the new approach, reconfiguring LiteLLM callbacks in Terraform to use OTEL instead of Langfuse, and introducing new OpenTelemetry configuration variables for endpoint and service name settings.

Changes

Cohort / File(s) Summary
Planning & Documentation
docs/planning/request_to_token_attribution.md
Refocuses Phase 1 from LiteLLM Custom Callback to OpenTelemetry Integration; replaces implementation plan with OTEL-centric approach; adds correlation-ID propagation methods; introduces implementation options matrix and refined event shapes aligned with new telemetry approach.
Infrastructure Configuration
infra/modules/aigateway_aca/main.tf, infra/modules/aigateway_aca/variables.tf
Replaces Langfuse tracing callbacks with OpenTelemetry across LiteLLM settings; adds OTEL_SERVICE_NAME and OTEL_TRACER_NAME configuration; introduces dynamic environment blocks for OTEL_EXPORTER_OTLP_ENDPOINT and OTEL_EXPORTER_OTLP_PROTOCOL; defines new variables for otel_exporter_endpoint and otel_service_name.

Estimated Code Review Effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 From Langfuse we hop to OpenTelemetry's glow,
Token tracing flows with OTEL's gentle show,
Configuration spans across the cloud so bright,
Observability bounds in correlation's light,
Our gateway now shines with structured delight! ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Description check ❓ Inconclusive The description includes a bulleted summary of changes but lacks completion of the checklist template sections: missing 'Why was it needed?', unchecked validation items, and unfilled deployment/risk fields. Complete the PR checklist by explaining why this change was needed, marking validation checkboxes, clarifying deployment requirements, and specifying risk level and rollback plan.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: adding OpenTelemetry support for request-to-token attribution, which aligns with all modified files and objectives.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/request-to-token-attribution
📝 Coding Plan
  • Generate coding plan for human review comments

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 and usage tips.

@JustAGhosT JustAGhosT merged commit 534c5dd into dev Mar 15, 2026
3 of 5 checks passed
@JustAGhosT JustAGhosT deleted the feat/request-to-token-attribution branch March 15, 2026 01:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant