Support OTLP standard environment variables for configuration
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 - [x] My PR's scope is as isolated as possible, it only solves 1 specific problem
Type
🆕 New Feature 📖 Documentation
Changes
- Default to OTLP standard, but fallback to existing so as to not break backwards compatibility
- Also allow/match the values expected in
OTEL_EXPORTER_OTLP_PROTOCOLofgrpc,http/protobuf, orhttp/jsonas outlined at https://opentelemetry.io/docs/languages/sdk-configuration/otlp-exporter/#otel_exporter_otlp_protocol - Changed documentation on the "Log to OTEL HTTP Collector" and "Log to OTEL GRPC Collector" tabs as they seem more related to OTLP standards than the other documented tabs
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 |
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