From 43719ec7373855f385d52f28b502e258220a58b6 Mon Sep 17 00:00:00 2001 From: Mark Backman Date: Fri, 30 May 2025 11:08:08 -0400 Subject: [PATCH] Update CHANGELOG --- CHANGELOG.md | 8 ++++++++ src/pipecat/utils/tracing/service_decorators.py | 12 ++++++------ 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c74400860..9c4940edf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added +- Added OpenTelemetry tracing for `GeminiMultimodalLiveLLMService` and + `OpenAIRealtimeBetaLLMService`. + - Added `interruption_strategies` to `PipelineParams` using `MinWordsInterruptionStrategy` to specify minimum words required to interrupt the bot when it's speaking. Use @@ -48,6 +51,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 `DailyTransport.stop_transcription()` to be able to start and stop Daily transcription dynamically (maybe with different settings). +### Changed + +- Updated OpenTelemetry tracing attribute `metrics.ttfb_ms` to `metrics.ttfb`. + The attribute reports TTFB in seconds. + ### Deprecated - `DailyTransport.send_dtmf()` is deprecated, push an `OutputDTMFFrame` or an diff --git a/src/pipecat/utils/tracing/service_decorators.py b/src/pipecat/utils/tracing/service_decorators.py index e4d50846a..c016827d6 100644 --- a/src/pipecat/utils/tracing/service_decorators.py +++ b/src/pipecat/utils/tracing/service_decorators.py @@ -761,9 +761,9 @@ def traced_gemini_live(operation: str) -> Callable: _add_token_usage_to_span(current_span, tokens) # Capture TTFB metric if available - ttfb_ms = getattr(getattr(self, "_metrics", None), "ttfb_ms", None) - if ttfb_ms is not None: - current_span.set_attribute("metrics.ttfb_ms", ttfb_ms) + ttfb = getattr(getattr(self, "_metrics", None), "ttfb", None) + if ttfb is not None: + current_span.set_attribute("metrics.ttfb", ttfb) # Run the original function result = await func(self, *args, **kwargs) @@ -979,9 +979,9 @@ def traced_openai_realtime(operation: str) -> Callable: _add_token_usage_to_span(current_span, tokens) # Capture TTFB metric if available - ttfb_ms = getattr(getattr(self, "_metrics", None), "ttfb_ms", None) - if ttfb_ms is not None: - current_span.set_attribute("metrics.ttfb_ms", ttfb_ms) + ttfb = getattr(getattr(self, "_metrics", None), "ttfb", None) + if ttfb is not None: + current_span.set_attribute("metrics.ttfb", ttfb) # Run the original function result = await func(self, *args, **kwargs)