From ca3addacc5ccf3012a4accb70e26e03ad1b2515d Mon Sep 17 00:00:00 2001 From: Federico Kamelhar Date: Fri, 18 Sep 2026 10:54:02 -0400 Subject: [PATCH] feat(otel): map the oci provider to gen_ai.provider.name=oracle_cloud.generative_ai OCI Generative AI calls currently reach OpenTelemetry backends with the raw litellm provider string "oci" as gen_ai.provider.name. Map it to oracle_cloud.generative_ai, the well-known value proposed in open-telemetry/semantic-conventions-genai#526, so OCI traffic groups with the other cloud providers instead of landing in a vendor bucket. Spans derive both gen_ai.provider.name and the deprecated gen_ai.system from the resolved provider, so both carry the mapped value; metric labels keep dual-emitting the raw string on gen_ai.system as before. --- litellm/integrations/otel/model/semconv.py | 2 ++ tests/unit/integrations/otel/test_otel_v2_sources_of_truth.py | 1 + 2 files changed, 3 insertions(+) diff --git a/litellm/integrations/otel/model/semconv.py b/litellm/integrations/otel/model/semconv.py index 8d186a2715a..1427589f586 100644 --- a/litellm/integrations/otel/model/semconv.py +++ b/litellm/integrations/otel/model/semconv.py @@ -68,6 +68,7 @@ class GenAIProvider(str, Enum): PERPLEXITY = "perplexity" X_AI = "x_ai" IBM_WATSONX_AI = "ibm.watsonx.ai" + ORACLE_CLOUD_GENERATIVE_AI = "oracle_cloud.generative_ai" class MCPMethod(str, Enum): @@ -390,6 +391,7 @@ _PROVIDER_BY_LITELLM: Final[dict[str, GenAIProvider]] = { "perplexity": GenAIProvider.PERPLEXITY, "xai": GenAIProvider.X_AI, "watsonx": GenAIProvider.IBM_WATSONX_AI, + "oci": GenAIProvider.ORACLE_CLOUD_GENERATIVE_AI, } # litellm ``call_type`` -> ``gen_ai.operation.name``. diff --git a/tests/unit/integrations/otel/test_otel_v2_sources_of_truth.py b/tests/unit/integrations/otel/test_otel_v2_sources_of_truth.py index 2d0b4701c9f..c1c01739f46 100644 --- a/tests/unit/integrations/otel/test_otel_v2_sources_of_truth.py +++ b/tests/unit/integrations/otel/test_otel_v2_sources_of_truth.py @@ -210,6 +210,7 @@ def test_provider_resolution(): assert resolve_provider("openai") == "openai" assert resolve_provider("bedrock") == "aws.bedrock" assert resolve_provider("vertex_ai") == "gcp.vertex_ai" + assert resolve_provider("oci") == "oracle_cloud.generative_ai" # unknown providers pass through verbatim (semconv allows provider-specific) assert resolve_provider("my_custom_llm") == "my_custom_llm" assert resolve_provider(None) == ""