fix(_service_logging.py): only trigger otel if in service_callback

Fixes https://github.com/BerriAI/litellm/issues/4511
This commit is contained in:
Krrish Dholakia 2024-07-03 09:48:19 -07:00
parent 2116dbcdc1
commit 606d04b05b
4 changed files with 64 additions and 16 deletions

View file

@ -1465,6 +1465,8 @@ class ProxyConfig:
open_telemetry_logger = OpenTelemetry()
imported_list.append(open_telemetry_logger)
litellm.service_callback.append("otel")
elif isinstance(callback, str) and callback == "presidio":
from litellm.proxy.hooks.presidio_pii_masking import (
_OPTIONAL_PresidioPIIMasking,