fix: don't log null values to otel (#2079)

This commit is contained in:
cthomas 2025-05-08 15:27:55 -07:00 committed by GitHub
parent d0c758125b
commit 2f097a89e1

View File

@ -72,7 +72,7 @@ async def sse_async_generator(
ttft_span = None
if request_start_timestamp_ns is not None:
ttft_span = tracer.start_span("time_to_first_token", start_time=request_start_timestamp_ns)
ttft_span.set_attributes({f"llm_config.{k}": v for k, v in llm_config.model_dump().items()})
ttft_span.set_attributes({f"llm_config.{k}": v for k, v in llm_config.model_dump().items() if v is not None})
try:
async for chunk in generator: