Skip to content

docs(otel-v2): document client metrics and shared cardinality filter#344

Merged
yassin-berriai merged 2 commits into
mainfrom
litellm_docs_otel_v2_metrics
Jun 13, 2026
Merged

docs(otel-v2): document client metrics and shared cardinality filter#344
yassin-berriai merged 2 commits into
mainfrom
litellm_docs_otel_v2_metrics

Conversation

@yassin-berriai

@yassin-berriai yassin-berriai commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Relevant issues

Documents the v2 OpenTelemetry metrics work landing in BerriAI/litellm (v2 OTEL now emits the six gen_ai.client.* metrics with the shared attribute cardinality filter).

What changed

Adds a "Metrics" section to the OTel v2 page (docs/observability/opentelemetry_v2.md) covering three things. First, v2 now emits GenAI client metrics when LITELLM_OTEL_INTEGRATION_ENABLE_METRICS=true (default off, so default behavior is unchanged), shipped through the same OTEL_EXPORTER / OTEL_ENDPOINT / OTEL_HEADERS exporter selection that traces already use. Second, the six emitted instruments with their exact names and units, matching v1 one-for-one so a dashboard built for either reads the other. Third, the metric attribute cardinality filter, which v2 reads from the same callback_settings.otel.attributes surface as v1 (mutually exclusive include_list / exclude_list, metrics-only scope, gen_ai.token.type never filtered out).

It also documents the v2-specific behavior confirmed against the implementation. The filter lives under callback_settings.otel without adding otel to callbacks, since that key would turn on the separate v1 integration while v2 stays driven by LITELLM_OTEL_V2. v2 has no per-instance attributes field, so the global block is the only source, and it resolves lazily on the first recorded metric rather than at startup; a bad config surfaces on that first request and edits take effect only after a restart. The filter applies only on the default OTLP path; preset destinations (arize, arize_phoenix, langfuse_otel, ...) emit with the full attribute set, the same as v1. The config-reference row for LITELLM_OTEL_INTEGRATION_ENABLE_METRICS now links to the new section.

Type

📖 Documentation

@vercel

vercel Bot commented Jun 12, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
litellm Ready Ready Preview, Comment Jun 12, 2026 10:50pm

Request Review

@yassin-berriai yassin-berriai merged commit dbedcb5 into main Jun 13, 2026
2 checks passed
@yassin-berriai yassin-berriai deleted the litellm_docs_otel_v2_metrics branch June 13, 2026 00:35
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.

2 participants