Merge pull request #3733 from pipecat-ai/mb/fix-traceable-init

Deprecate unused class_decorators tracing module and fix stale comments
This commit is contained in:
Mark Backman
2026-02-13 13:04:34 -05:00
committed by GitHub
3 changed files with 17 additions and 2 deletions

View File

@@ -0,0 +1 @@
- Deprecated unused `Traceable`, `@traceable`, `@traced`, and `AttachmentStrategy` in `pipecat.utils.tracing.class_decorators`. This module will be removed in a future release.

View File

@@ -7,6 +7,11 @@
"""Base OpenTelemetry tracing decorators and utilities for Pipecat. """Base OpenTelemetry tracing decorators and utilities for Pipecat.
.. deprecated:: 0.0.103
This module is unused and will be removed in a future release.
Service tracing is handled by the decorators in
:mod:`pipecat.utils.tracing.service_decorators`.
This module provides class and method level tracing capabilities This module provides class and method level tracing capabilities
similar to the original NVIDIA implementation. similar to the original NVIDIA implementation.
""" """
@@ -16,8 +21,16 @@ import contextlib
import enum import enum
import functools import functools
import inspect import inspect
import warnings
from typing import Callable, Optional, TypeVar from typing import Callable, Optional, TypeVar
warnings.warn(
"pipecat.utils.tracing.class_decorators is deprecated and will be removed in a future "
"release. Use pipecat.utils.tracing.service_decorators instead.",
DeprecationWarning,
stacklevel=2,
)
from pipecat.utils.tracing.setup import is_tracing_available from pipecat.utils.tracing.setup import is_tracing_available
# Import OpenTelemetry if available # Import OpenTelemetry if available

View File

@@ -82,11 +82,12 @@ def _get_parent_service_context(self):
if not is_tracing_available(): if not is_tracing_available():
return None return None
# The parent span was created when Traceable was initialized and stored as self._span # TODO: Remove this block and delete class_decorators.py once Traceable is removed.
# Legacy: support for classes inheriting from Traceable (currently unused, deprecated).
if hasattr(self, "_span") and self._span: if hasattr(self, "_span") and self._span:
return trace.set_span_in_context(self._span) return trace.set_span_in_context(self._span)
# Fall back to conversation context if available # Use the conversation context set by TurnTraceObserver via TracingContext.
tracing_ctx = getattr(self, "_tracing_context", None) tracing_ctx = getattr(self, "_tracing_context", None)
conversation_context = tracing_ctx.get_conversation_context() if tracing_ctx else None conversation_context = tracing_ctx.get_conversation_context() if tracing_ctx else None
if conversation_context: if conversation_context: