diff --git a/litellm/integrations/opentelemetry.py b/litellm/integrations/opentelemetry.py index 4ed561116..215a4f09f 100644 --- a/litellm/integrations/opentelemetry.py +++ b/litellm/integrations/opentelemetry.py @@ -288,6 +288,11 @@ class OpenTelemetry(CustomLogger): ) pass + def is_primitive(self, value): + if value is None: + return False + return isinstance(value, (str, bool, int, float)) + def set_attributes(self, span: Span, kwargs, response_obj): from litellm.proxy._types import SpanAttributes @@ -296,6 +301,14 @@ class OpenTelemetry(CustomLogger): # https://github.com/open-telemetry/semantic-conventions/blob/main/model/registry/gen-ai.yaml # Following Conventions here: https://github.com/open-telemetry/semantic-conventions/blob/main/docs/gen-ai/llm-spans.md + ############################################# + ############ LLM CALL METADATA ############## + ############################################# + metadata = litellm_params.get("metadata", {}) or {} + + for key, value in metadata.items(): + if self.is_primitive(value): + span.set_attribute("metadata.{}".format(key), value) ############################################# ########## LLM Request Attributes ########### @@ -474,8 +487,6 @@ class OpenTelemetry(CustomLogger): _raw_response, ) - pass - def _to_ns(self, dt): return int(dt.timestamp() * 1e9) diff --git a/litellm/proxy/_experimental/out/404.html b/litellm/proxy/_experimental/out/404.html deleted file mode 100644 index fcdc3749f..000000000 --- a/litellm/proxy/_experimental/out/404.html +++ /dev/null @@ -1 +0,0 @@ -404: This page could not be found.LiteLLM Dashboard

404

This page could not be found.

\ No newline at end of file diff --git a/litellm/proxy/_experimental/out/model_hub.html b/litellm/proxy/_experimental/out/model_hub.html deleted file mode 100644 index d298ea683..000000000 --- a/litellm/proxy/_experimental/out/model_hub.html +++ /dev/null @@ -1 +0,0 @@ -LiteLLM Dashboard \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/onboarding.html b/litellm/proxy/_experimental/out/onboarding.html deleted file mode 100644 index 87ea00cc7..000000000 --- a/litellm/proxy/_experimental/out/onboarding.html +++ /dev/null @@ -1 +0,0 @@ -LiteLLM Dashboard \ No newline at end of file