fix trace hierarchy on otel

This commit is contained in:
Ishaan Jaff 2024-07-06 15:37:23 -07:00
parent f4eb04640c
commit 196884a779
2 changed files with 3 additions and 0 deletions

View file

@ -31,10 +31,12 @@ def initialize_callbacks_on_proxy(
imported_list.append(callback)
elif isinstance(callback, str) and callback == "otel":
from litellm.integrations.opentelemetry import OpenTelemetry
from litellm.proxy import proxy_server
open_telemetry_logger = OpenTelemetry()
imported_list.append(open_telemetry_logger)
setattr(proxy_server, "open_telemetry_logger", open_telemetry_logger)
elif isinstance(callback, str) and callback == "presidio":
from litellm.proxy.hooks.presidio_pii_masking import (
_OPTIONAL_PresidioPIIMasking,

View file

@ -35,6 +35,7 @@ general_settings:
LANGFUSE_SECRET_KEY: "os.environ/LANGFUSE_DEV_SK_KEY"
litellm_settings:
callbacks: ["otel"]
guardrails:
- prompt_injection:
callbacks: [lakera_prompt_injection, hide_secrets]