fix svc logger (#7727)

This commit is contained in:
Ishaan Jaff 2025-01-12 22:00:25 -08:00 committed by GitHub
parent e063c5a075
commit feee37e37f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -8,14 +8,13 @@ from litellm.proxy._types import UserAPIKeyAuth
from .integrations.custom_logger import CustomLogger from .integrations.custom_logger import CustomLogger
from .integrations.datadog.datadog import DataDogLogger from .integrations.datadog.datadog import DataDogLogger
from .integrations.opentelemetry import OpenTelemetry
from .integrations.prometheus_services import PrometheusServicesLogger from .integrations.prometheus_services import PrometheusServicesLogger
from .types.services import ServiceLoggerPayload, ServiceTypes from .types.services import ServiceLoggerPayload, ServiceTypes
if TYPE_CHECKING: if TYPE_CHECKING:
from opentelemetry.trace import Span as _Span from opentelemetry.trace import Span as _Span
from litellm.integrations.opentelemetry import OpenTelemetry
Span = _Span Span = _Span
OTELClass = OpenTelemetry OTELClass = OpenTelemetry
else: else:
@ -116,8 +115,6 @@ class ServiceLogging(CustomLogger):
""" """
- For counting if the redis, postgres call is successful - For counting if the redis, postgres call is successful
""" """
from litellm.integrations.opentelemetry import OpenTelemetry
if self.mock_testing: if self.mock_testing:
self.mock_testing_async_success_hook += 1 self.mock_testing_async_success_hook += 1
@ -190,7 +187,6 @@ class ServiceLogging(CustomLogger):
initializes otel_logger if it is None or no attribute exists on ServiceLogging Object initializes otel_logger if it is None or no attribute exists on ServiceLogging Object
""" """
from litellm.integrations.opentelemetry import OpenTelemetry
from litellm.proxy.proxy_server import open_telemetry_logger from litellm.proxy.proxy_server import open_telemetry_logger
if not hasattr(self, "otel_logger"): if not hasattr(self, "otel_logger"):
@ -218,8 +214,6 @@ class ServiceLogging(CustomLogger):
""" """
- For counting if the redis, postgres call is unsuccessful - For counting if the redis, postgres call is unsuccessful
""" """
from litellm.integrations.opentelemetry import OpenTelemetry
if self.mock_testing: if self.mock_testing:
self.mock_testing_async_failure_hook += 1 self.mock_testing_async_failure_hook += 1