paddy
paddy

Reputation: 23

Enabling auto_log_stacks on Sentry for python app

According to Sentry's Documentation here: https://docs.getsentry.com/on-premise/clients/python/integrations/logging/

Under the usage head they recommend not to use auto_log_stacks=true but it is not said why they do not recommend this. Does anyone know any issues about using this option in live?

Upvotes: 2

Views: 292

Answers (1)

David Cramer
David Cramer

Reputation: 1998

There are some cases where inspect.stack() (the functionality used by Sentry to fetch the callstack) might be inaccurate.

For example, if you're using the logging handler integration, which is the most common way captureMessage would get called, it's possible that the point in which emit() is called has a differing stacktrace from the original call. This isn't very common, but its highly dependent on how the logging stack is being used.

Additionally the calls to inspect.stack() aren't free. The performance costs aren't considerable, but its worth noting.

The primary reason we (Sentry) pushes back on this kind of functionality is that often captureMessage is not needed. It's primarily used with logging, and Sentry is not intended to aggregate logs. The only truly supported case would be something like log.warning() which is something we feel is actionable, but not an exception.

Upvotes: 3

Related Questions