fix otel logging fixes

This commit is contained in:
Ishaan Jaff 2024-06-04 08:53:33 -07:00
parent 009c63f194
commit e96d2e3b1b
2 changed files with 8 additions and 0 deletions

View file

@ -33,6 +33,8 @@ class OpenTelemetry(CustomLogger):
from opentelemetry.sdk.trace import TracerProvider from opentelemetry.sdk.trace import TracerProvider
self.config = config self.config = config
self.OTEL_ENDPOINT = self.config.endpoint
self.OTEL_BEARER_TOKEN = self.config.bearer_token
provider = TracerProvider(resource=Resource(attributes=LITELLM_RESOURCE)) provider = TracerProvider(resource=Resource(attributes=LITELLM_RESOURCE))
provider.add_span_processor(self._get_span_processor()) provider.add_span_processor(self._get_span_processor())

View file

@ -2399,6 +2399,12 @@ class ProxyConfig:
and callback in known_compatible_callbacks and callback in known_compatible_callbacks
): ):
imported_list.append(callback) imported_list.append(callback)
elif isinstance(callback, str) and callback == "otel":
from litellm.integrations.opentelemetry import (
OpenTelemetry,
)
imported_list.append(OpenTelemetry())
elif isinstance(callback, str) and callback == "presidio": elif isinstance(callback, str) and callback == "presidio":
from litellm.proxy.hooks.presidio_pii_masking import ( from litellm.proxy.hooks.presidio_pii_masking import (
_OPTIONAL_PresidioPIIMasking, _OPTIONAL_PresidioPIIMasking,