I am trying to integrate Sentry. How and where can...
# agents
p
I am trying to integrate Sentry. How and where can I properly flush sentry logs at the end of a session? This does not work for me:
Copy code
async def on_shutdown():
        <http://sentry_logger.info|sentry_logger.info>("session_ended")
        
        sentry_sdk.flush(timeout=5.0)

    ctx.add_shutdown_callback(on_shutdown)
l
We support forwarding logs to Sentry automatically: https://docs.livekit.io/deploy/agents/cloud/logs/#sentry, which might be a better approach?
p
yeah but this only works if I deploy an agent to livekit cloud right?
I had to change the transport of sentry, but I hope this does not have any side effects
Copy code
class FixedTimeoutTransport(HttpTransport):
    def _get_pool_options(self):
        opts = super()._get_pool_options()
        # explicit connect/read timeouts
        opts["timeout"] = urllib3.Timeout(connect=1.0, read=2.0)
        return opts
l
yeah but this only works if I deploy an agent to livekit cloud right?
Yes, sorry I should have said.