Repository navigation
Description
Problem or Motivation
The LiteLLM gateway (namespace llm, image ghcr.io/berriai/litellm:v1.103.10) sends no spans. Its config has callbacks: ["prometheus"] only (k8s/llm/gateway/config.yaml), and the Deployment sets no OTEL_* variable. Tempo has no gateway service. Thus the time that a call waits in the gateway queue, and the time of its retries and fallbacks, is not visible in a trace.
The LiteLLM OpenTelemetry callback writes key data on each span, also when message logging is off. The LiteLLM page says: "LiteLLM emits metadata.user_api_key_* attributes (key hash, key alias, org ID, user ID, team ID)" and "LiteLLM iterates standard_logging_payload["metadata"] and emits each entry as metadata.{key}" (https://docs.litellm.ai/docs/observability/opentelemetry_integration). At v1.103.10, set_attributes in litellm/integrations/opentelemetry.py writes each metadata key, and StandardLoggingUserAPIKeyMetadata in litellm/types/utils.py holds user_api_key_hash, user_api_key_alias, user_api_key_user_email and user_api_key_auth_metadata. A refused key also puts its SHA-256 hash in the error text: "Key Hash (Token) =" (litellm/proxy/auth/user_api_key_auth.py), which goes to the exception attribute and to the exception event.
Proposed Solution & Architectural Design
Defence in depth, as the owner decided on 2026-11-11:
- Gateway: add the
otelcallback and keepprometheus. Setturn_off_message_logging: true; the LiteLLM page says that this setting "forcesNO_CONTENT" and overrides each other content setting. Send OTLP over HTTP to the in-cluster Service of the Collector on port 4318. Keep LiteLLM metrics and events export off (the defaults). - Collector (
k8s/otel/values.yaml): add atransformprocessor to the traces pipeline, before the Tempo exporter. It deletes eachmetadata.user_api_key_*andmetadata.requester_custom_headersattribute, and each attribute whose name holdsauthorizationorapi-key, from spans and span events. It replaces each 64-character hex value (a SHA-256 key hash) in gateway spans and events. Docs: the transform processor and the OTTL functionsdelete_matching_keysandreplace_all_patternsat v0.161.0 of opentelemetry-collector-contrib. - Network: let the gateway pod send to namespace
otelon TCP 4318. The Collector policy already admits port 4318 from all namespaces.
A check of the k8s row of devops ci proves that the processor is in the traces pipeline before the exporter, and that its patterns delete the LiteLLM key attributes and keep the other attributes.
Gateway spans become children of devops-cli spans only when the client sends traceparent. UnifiedClient sends it now. The pydantic-ai path sends it after the agent spans change of #2536. This item ships alone.
Target Subsystem
Kubernetes & Minikube Automation
Existing Tool Considered
The LiteLLM otel callback (built in) and the OpenTelemetry Collector transform processor (in the contrib image that runs now). No code is built.
Activity
dan-petty commentedon Nov 11, 2026
Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.
featprefix of the title gives the type.(k8s)scope of the title gives the scope.It improves observability of gateway queue time and retries but does not block a release or fix a defect.Users gain visibility into gateway wait time, retries, and fallbacks in traces.It needs gateway config, a Collector transform processor, and a network policy change across three components.Both items send spans through the OTel pipeline, but the candidate adds gateway spans while #4515 adds pydantic-ai spans.devops-cli-service commentedon Nov 11, 2026
Released in v0.112.0: https://github.com/dan-petty/devops-cli/releases/tag/v0.112.0
devops-cli-service commentedon Nov 11, 2026
Live since 2026-11-11 14:13 UTC