The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]
Python ai-gatewayanthropicazure-openaibedrockgatewaylangchainlitellmllmllm-gatewayllmopsmcp-gatewayopenaiopenai-proxyrustrust-aivertex-ai
test_logging_opentelemetry_context_propagation
Ishaan Jaff69e451458c3b
diff --git a/tests/test_litellm/litellm_core_utils/test_litellm_logging.py b/tests/test_litellm/litellm_core_utils/test_litellm_logging.pyindex fa5164b9c16..f26d93bced8 100644--- a/tests/test_litellm/litellm_core_utils/test_litellm_logging.py+++ b/tests/test_litellm/litellm_core_utils/test_litellm_logging.py@@ -473,13 +473,16 @@ async def test_logging_opentelemetry_context_propagation():Test that OpenTelemtry context propagation works with async completion."""import asyncio- import litellm- from litellm.integrations.custom_logger import CustomLoggerfrom opentelemetry import tracefrom opentelemetry.sdk.trace import TracerProviderfrom opentelemetry.sdk.trace.export import SimpleSpanProcessor- from opentelemetry.sdk.trace.export.in_memory_span_exporter import InMemorySpanExporter+ from opentelemetry.sdk.trace.export.in_memory_span_exporter import (+ InMemorySpanExporter,+ )++ import litellm+ from litellm.integrations.custom_logger import CustomLoggerprovider = TracerProvider()exporter = InMemorySpanExporter()@@ -490,7 +493,7 @@ async def test_logging_opentelemetry_context_propagation():class MockOpenTelemetryLogger(CustomLogger):async def async_log_success_event(self, kwargs, response_obj, start_time, end_time):span = tracer.start_span(start_time=start_time.timestamp() * 1e9, name="async_log_success_event")- span.end(end_time=end_time)+ span.end(end_time=end_time.timestamp() * 1e9)mock_logging_obj = MockOpenTelemetryLogger()