You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to use the SentryMetrics class to monitor performance as described in the docs here. However, even though I have Sentry installed and initialised at the point of server startup, I always get this warning:
2025-01-09 09:56:01.597 | WARNING | pipecat.processors.metrics.sentry:<module>:16 - Sentry SDK not initialized. Sentry features will be disabled.
I have confirmed that sentry is initialised using sentry_sdk.is_initialized() just before instantiating the SentryMetrics class. I think the issue is that within the SentryMetrics class itself, the check to see whether Sentry is active occurs as soon as it is imported, not instantiated. As it is not a property of the class itself, it is impossible to change manually:
try:
import sentry_sdk
sentry_available = sentry_sdk.is_initialized()
if not sentry_available:
logger.warning("Sentry SDK not initialized. Sentry features will be disabled.")
except ImportError:
sentry_available = False
logger.warning("Sentry SDK not installed. Sentry features will be disabled.")
from pipecat.processors.metrics.frame_processor_metrics import FrameProcessorMetrics
Repro steps
Initiate sentry using sentry_sdk.init()
Set SentryMetrics as the _metrics property within a FrameProcessor class
Warning appears in logs
Expected behavior
SentryMetrics should check Sentry initialisation at the point of being instantiated
Actual behavior
Checks behaviour too early and is always disabled
Logs
2025-01-09 09:56:01.597 | WARNING | pipecat.processors.metrics.sentry:<module>:16 - Sentry SDK not initialized. Sentry features will be disabled.
INFO:config.db:Connecting to dev main at *** as ***
INFO:config.db:Created connection pool to main at *** as ***
INFO:root:Sentry initialized for development environment. <-- Point of Sentry initialisation, even though it is before the Pipecat process is set up
The text was updated successfully, but these errors were encountered:
Description
Environment
Issue description
I am trying to use the
SentryMetrics
class to monitor performance as described in the docs here. However, even though I have Sentry installed and initialised at the point of server startup, I always get this warning:I have confirmed that sentry is initialised using
sentry_sdk.is_initialized()
just before instantiating theSentryMetrics
class. I think the issue is that within theSentryMetrics
class itself, the check to see whether Sentry is active occurs as soon as it is imported, not instantiated. As it is not a property of the class itself, it is impossible to change manually:Repro steps
sentry_sdk.init()
SentryMetrics
as the_metrics
property within aFrameProcessor
classExpected behavior
SentryMetrics
should check Sentry initialisation at the point of being instantiatedActual behavior
Checks behaviour too early and is always disabled
Logs
The text was updated successfully, but these errors were encountered: