litellm icon indicating copy to clipboard operation
litellm copied to clipboard

Support OTLP standard environment variables for configuration

Open damienpontifex opened this issue 11 months ago • 3 comments

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_PROTOCOL of grpc, http/protobuf, or http/json as 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

damienpontifex avatar May 14 '25 01:05 damienpontifex

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

vercel[bot] avatar May 14 '25 01:05 vercel[bot]

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar May 14 '25 01:05 CLAassistant

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 avatar May 14 '25 02:05 damienpontifex