litellm/litellm/integrations
yucheng-berri 1f9323792c
fix(otel): one v2 logger owns the global provider; scope tenant OTLP creds per exporter (#30590)
* fix(otel): one v2 logger owns the global provider; scope tenant creds per exporter

The proxy published the OTel global TracerProvider before callbacks were
initialized, so no preset logger existed yet and a second generic logger was
built that won the global provider. Server spans then exported through a
different provider than the preset's gen-ai spans, orphaning the LLM span on
the preset backend. Publish after callback init and reuse the already-built
logger instead.

Separately, per-request tenant OTLP credentials were stamped onto every OTLP
exporter, leaking one backend's key onto a co-configured backend. Tag each
exporter with the preset that contributed it and apply dynamic credentials
only to the matching owner.

* fix(otel): satisfy Any-discipline on changed lines

Type the logger-selection parameter as Sequence[object] (isinstance narrows
it), cast the list[Any] global at the single call site, and pass model_copy a
typed dict[str, str] update so no changed line carries an Any value.

* fix(otel): annotate the untyped-global boundary with any-ok

select_global_otel_v2_logger consumes litellm._in_memory_loggers, a shared
List[Any] global this change does not own. A cast doesn't satisfy the
Any-discipline checker (it inspects the inner expression), and re-annotating the
global is out of scope, so mark the single boundary line any-ok.

* test(otel): cover the startup global-provider publish via injectable helper

The publish step lived inline in proxy_startup_event (a FastAPI lifespan unit
tests do not execute), so its lines were uncovered though the selection logic
was tested. Extract publish_global_otel_v2_provider, which selects the single v2
logger and publishes its provider through an injected setter, and unit-test that
the published provider is the selected logger's. proxy_server delegates to it.

* refactor(otel): select global provider from the registered owner, not a list scan

The startup publish picked the global TracerProvider by scanning
_in_memory_loggers for the first OpenTelemetryV2, re-deriving an answer the
factory already settled: the first logger built registers itself as
proxy_server.open_telemetry_logger, and every other v2 path (guardrail, identity
seeding, phase spans) routes through that owner via _registered_v2_logger. Pass
that owner into select_global_otel_v2_logger so the global provider reuses the
same logger instead of an independent, order-dependent guess; the list scan
remains the SDK-path fallback. The owner is injected at the proxy call site to
keep the helper free of hidden global reads.

* refactor(otel): type ExporterSpec.owner as an ExporterOwner enum

The owner field carried free-form strings that had to match preset callback
names. Introduce a str-based ExporterOwner enum (values equal to the callback
names, so per-request credential routing's owner==callback_name comparison still
holds) and have each preset tag its exporter with the enum member.

* refactor(otel): rename ExporterOwner.ARIZE to ARIZE_AX

Distinguish the hosted Arize AX backend from Arize Phoenix at the member level
while keeping the value 'arize' (the public callback name routing compares
against). Add a comment noting AX and Phoenix are separate backends.
2026-06-19 11:15:29 -07:00
..
_types style: run black formatter on entire codebase 2026-03-11 17:07:57 -03:00
agentops style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
arize feat(arize/phoenix): OpenInference rendering parity — tool_calls, cost, passthrough I/O, session/user, multimodal, cache tokens (#28800) 2026-06-03 12:09:50 -07:00
azure_sentinel Add Azure Sentinel audit log support (#27280) 2026-05-06 15:50:06 -07:00
azure_storage style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
bitbucket fix(security): sandbox jinja2 in gitlab/arize/bitbucket prompt managers 2026-05-02 09:14:02 +00:00
cloudzero style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
compression_interception fix(callbacks): forward callback_settings to callback initializers and guard consumers against non-dict values (#30161) 2026-06-10 15:22:00 -07:00
datadog chore(oss): litellm oss staging 120626 (#30292) 2026-06-12 09:49:25 -07:00
deepeval fix: use fastuuid helper (#14903) 2025-09-25 15:47:01 -07:00
dotprompt fix(proxy): improve input validation on management endpoints 2026-04-09 14:14:53 -07:00
email_templates style: run black formatter on entire codebase 2026-03-11 17:07:57 -03:00
focus feat: litellm oss 110626 (#30202) 2026-06-11 22:30:26 -07:00
gcs_bucket fix cloud storage file guards 2026-05-01 15:34:11 -07:00
gcs_pubsub Fix gcs pub sub logging with env var GCS_PROJECT_ID (#10042) 2025-04-15 21:50:48 -07:00
generic_api feat(logging): add retry settings for generic API logger (#26645) 2026-04-28 08:38:17 -07:00
generic_prompt_management style: run black formatter on entire codebase 2026-03-11 17:07:57 -03:00
gitlab fix(security): sandbox jinja2 in gitlab/arize/bitbucket prompt managers 2026-05-02 09:14:02 +00:00
langfuse chore(lint): remove PLR0915 too-many-statements ruff rule (#30574) 2026-06-16 16:52:49 -07:00
levo docs: remove docs/my-website, point contributors to litellm-docs 2026-04-24 14:17:46 -07:00
litellm_agent Agent Builder - support new experimental agent builder, to ensure agents pass compliance checks (#21817) 2026-02-21 15:32:47 -08:00
mavvrik_focus feat: litellm oss 110626 (#30202) 2026-06-11 22:30:26 -07:00
newrelic feat: litellm oss 110626 (#30202) 2026-06-11 22:30:26 -07:00
opentelemetry_utils feat: add OTEL GenAI latest-experimental semantic convention support (#27418) 2026-05-15 17:20:04 -07:00
opik Litellm oss staging 030626 (#29578) 2026-06-03 11:01:51 -07:00
otel fix(otel): one v2 logger owns the global provider; scope tenant OTLP creds per exporter (#30590) 2026-06-19 11:15:29 -07:00
prometheus_helpers perf: cap Prometheus end-user metric cardinality with TTL + LRU eviction (#27272) 2026-05-06 13:35:13 -07:00
SlackAlerting chore(lint): remove PLR0915 too-many-statements ruff rule (#30574) 2026-06-16 16:52:49 -07:00
vantage style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
vector_store_integrations style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
weave style: run black formatter on entire codebase 2026-03-11 17:07:57 -03:00
websearch_interception ci(lint): add blanket-noqa, dataclass-default, and unused-noqa Ruff rules (#30516) 2026-06-16 12:07:22 -07:00
__init__.py add linting 2023-08-18 11:05:05 -07:00
additional_logging_utils.py build(deps-dev): bump black to 26.3.1 and apply formatting (#28525) 2026-05-21 17:24:18 -07:00
anthropic_cache_control_hook.py fix(integrations): cap Anthropic cache_control injection at 4 blocks (#30480) 2026-06-15 20:50:38 -07:00
argilla.py build(pyproject.toml): add new dev dependencies - for type checking (#9631) 2025-03-29 11:02:13 -07:00
athina.py build(pyproject.toml): add new dev dependencies - for type checking (#9631) 2025-03-29 11:02:13 -07:00
braintrust_logging.py chore(lint): remove PLR0915 too-many-statements ruff rule (#30574) 2026-06-16 16:52:49 -07:00
braintrust_mock_client.py style: run black formatter on entire codebase 2026-03-11 17:07:57 -03:00
callback_configs.json feat: litellm oss 110626 (#30202) 2026-06-11 22:30:26 -07:00
custom_batch_logger.py build(deps-dev): bump black to 26.3.1 and apply formatting (#28525) 2026-05-21 17:24:18 -07:00
custom_guardrail.py chore(oss): litellm oss staging 150626 (#30463) 2026-06-16 12:06:41 -07:00
custom_logger.py Emit native web_search_tool_result blocks for Anthropic clients (Claude Desktop / Cowork citations) (#27886) 2026-05-14 12:30:47 -07:00
custom_prompt_management.py [Fix] CI/CD - mypy & check_code_and_doc_quality & mcp_testing (#17920) 2025-12-13 08:18:43 -08:00
custom_secret_manager.py style: run black formatter on entire codebase 2026-03-11 17:07:57 -03:00
custom_sso_handler.py chore(auth): require trusted proxy for header identity auth 2026-04-29 21:20:21 -07:00
dynamodb.py fix: use fastuuid helper (#14903) 2025-09-25 15:47:01 -07:00
email_alerting.py feat(litellm): add models and repository layers (#29686) 2026-06-06 20:59:33 -07:00
galileo.py feat(galileo): add health check support for UI callback test (#29908) 2026-06-08 13:57:03 -07:00
greenscale.py LITELLM: Remove requests library usage (#7235) 2024-12-17 12:50:04 -08:00
helicone.py style: run black formatter on entire codebase 2026-03-11 17:07:57 -03:00
helicone_mock_client.py style: run black formatter on entire codebase 2026-03-11 17:07:57 -03:00
humanloop.py style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
lago.py fix: use fastuuid helper (#14903) 2025-09-25 15:47:01 -07:00
langsmith.py Merge pull request #26894 from BerriAI/litellm_langsmithRedactApiInfo 2026-05-04 09:55:59 -07:00
langsmith_mock_client.py style: run black formatter on entire codebase 2026-03-11 17:07:57 -03:00
langtrace.py build(pyproject.toml): add new dev dependencies - for type checking (#9631) 2025-03-29 11:02:13 -07:00
literal_ai.py fix: use fastuuid helper (#14903) 2025-09-25 15:47:01 -07:00
logfire_logger.py fix: use fastuuid helper (#14903) 2025-09-25 15:47:01 -07:00
lunary.py ci(lint): add blanket-noqa, dataclass-default, and unused-noqa Ruff rules (#30516) 2026-06-16 12:07:22 -07:00
mlflow.py Fix: MLflow streaming spans for Anthropic passthrough (#17288) 2025-12-05 14:59:36 -08:00
mock_client_factory.py chore(lint): remove PLR0915 too-many-statements ruff rule (#30574) 2026-06-16 16:52:49 -07:00
openmeter.py Litellm oss staging 050626 (#29774) 2026-06-05 13:51:51 -07:00
opentelemetry.py chore(lint): remove PLR0915 too-many-statements ruff rule (#30574) 2026-06-16 16:52:49 -07:00
posthog.py style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
posthog_mock_client.py style: run black formatter on entire codebase 2026-03-11 17:07:57 -03:00
prometheus.py chore(lint): remove PLR0915 too-many-statements ruff rule (#30574) 2026-06-16 16:52:49 -07:00
prometheus_services.py style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
prompt_layer.py LITELLM: Remove requests library usage (#7235) 2024-12-17 12:50:04 -08:00
prompt_management_base.py fix: trim caller-supplied dicts from compile_prompt error message 2026-04-29 15:16:01 -07:00
Readme.md (Feat) - Add GCS Pub/Sub Logging integration for sending DB SpendLogs to BigQuery (#7976) 2025-01-24 20:57:20 -08:00
rubrik.py Litellm oss staging 04 21 2026 2 (#26569) 2026-05-20 21:25:19 -07:00
s3.py Add allowing Key based prefix to s3 path (#16237) 2025-11-05 14:43:21 -08:00
s3_v2.py build(deps-dev): bump black to 26.3.1 and apply formatting (#28525) 2026-05-21 17:24:18 -07:00
sqs.py style: run black formatter on entire codebase 2026-03-11 17:07:57 -03:00
supabase.py (code quality) run ruff rule to ban unused imports (#7313) 2024-12-19 12:33:42 -08:00
test_httpx.py fix(utils.py): improved predibase exception mapping 2024-06-08 14:32:43 -07:00
traceloop.py (code quality) run ruff rule to ban unused imports (#7313) 2024-12-19 12:33:42 -08:00
weights_biases.py ci(lint): add blanket-noqa, dataclass-default, and unused-noqa Ruff rules (#30516) 2026-06-16 12:07:22 -07:00

Integrations

This folder contains logging integrations for litellm

eg. logging to Datadog, Langfuse, Prometheus, s3, GCS Bucket, etc.