-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Provide a processor to support stack_info
#87
Comments
Cross linking in case this ends up just being supported in Sentry's SDK: getsentry/sentry-python#1204 is for a similar feature on their side. |
I spent a bunch of time on this but was able to get stack traces set via changing the event, hint = {}, {}
with capture_internal_exceptions():
event["threads"] = {
"values": [
{
"stacktrace": current_stacktrace(
include_local_variables=options["include_local_variables"],
max_value_length=options["max_value_length"],
),
"crashed": False,
"current": True,
}
]
} It seems the issue is sentry trying to work around some oddity in celery so now this has to work around that - https://github.com/getsentry/sentry-python/blob/master/sentry_sdk/integrations/logging.py#L198 It's still odd that you can't specifically tell the the I'm thinking this should be an option in the SentryProcessor init or detected automatically if |
The standard library supports passing
stack_info
as a kwarg to log lines which aren't exceptions but you still want a stack trace, which can be useful for logging usages of a function. (The docs are part ofLogger.debug
's docs)structlog
also supports this through itsStackInfoRenderer
, however that renders to a string which then doesn't work well in Sentry.It would be great if this library contained a similar processor which emitted the data in the format which Sentry expects.
sentry_sdk.utlis.current_stacktrace
looks like it might be useful for this, though I'm not sure how you'd get the data into the right place on the event object to ensure it shows up as a full stack (rather than as data) in the UI.Broadly what I'm trying to achieve here is like Sentry's
attach_stacktrace
client option, but available on a per-log basis rather than a setting on the client as a whole.The text was updated successfully, but these errors were encountered: