Skip to content

Support OTLP standard environment variables for configuration #10813

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

damienpontifex
Copy link
Contributor

@damienpontifex damienpontifex commented May 14, 2025

Support open telemetry standard environment variables for OTLP exporter

Systems often inject these variables, or equally developers expect to have a consistent set of configuration options when relating to opentelemetry. Environment variables for the open telemetry OTLP exporter are outlined at https://opentelemetry.io/docs/languages/sdk-configuration/otlp-exporter/ for their standards.

This adds in the option to utilise those environment variables, without introducing a breaking change, by falling back to the currently documented process.

Relevant issues

Relates to #9901

Also relates to PR #9972 but I had confusion on that PR, as it doesn't reference environment variables such as OTEL_EXPORTER_OTLP_PROTOCOL, or OTEL_EXPORTER_OTLP_ENDPOINT as I had expected

Pre-Submission checklist

Please complete all items before asking a LiteLLM maintainer to review your PR

  • I have Added testing in the tests/litellm/ directory, Adding at least 1 test is a hard requirement - see details
  • I have added a screenshot of my new test passing locally
  • My PR passes all unit tests on make test-unit
  • My PR's scope is as isolated as possible, it only solves 1 specific problem

Type

🆕 New Feature
📖 Documentation

Changes

- Environment variables outlined at https://opentelemetry.io/docs/languages/sdk-configuration/otlp-exporter/
- Default to OTLP standard, but fallback to existing so as to not break backwards compatibility
Copy link

vercel bot commented May 14, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
litellm ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 14, 2025 1:58am

@CLAassistant
Copy link

CLAassistant commented May 14, 2025

CLA assistant check
All committers have signed the CLA.

@damienpontifex
Copy link
Contributor Author

Apologies for not running tests locally, had all sorts of errors on "Installing tiktoken" that I'd have to dive into much deeper than an environment variable change to understand

@damienpontifex damienpontifex changed the title Supper OTLP standard environment variables for configuration Support OTLP standard environment variables for configuration May 14, 2025
Copy link
Contributor

@ishaan-jaff ishaan-jaff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM !

@ishaan-jaff ishaan-jaff merged commit 63a4287 into BerriAI:main May 15, 2025
5 of 6 checks passed
@damienpontifex damienpontifex deleted the otlp-exporter-configuration branch May 15, 2025 00:41
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.

3 participants