docs(otel-v2): document client metrics and shared cardinality filter#344
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
yuneng-berri
approved these changes
Jun 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 sameOTEL_EXPORTER/OTEL_ENDPOINT/OTEL_HEADERSexporter 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 samecallback_settings.otel.attributessurface as v1 (mutually exclusiveinclude_list/exclude_list, metrics-only scope,gen_ai.token.typenever filtered out).It also documents the v2-specific behavior confirmed against the implementation. The filter lives under
callback_settings.otelwithout addingoteltocallbacks, since that key would turn on the separate v1 integration while v2 stays driven byLITELLM_OTEL_V2. v2 has no per-instanceattributesfield, 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 forLITELLM_OTEL_INTEGRATION_ENABLE_METRICSnow links to the new section.Type
📖 Documentation