Skip to content
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

Bring back support for including stacktrace #537

Closed
nijel opened this issue Oct 21, 2019 · 6 comments
Closed

Bring back support for including stacktrace #537

nijel opened this issue Oct 21, 2019 · 6 comments

Comments

@nijel
Copy link
Contributor

nijel commented Oct 21, 2019

Raven had support for including stacktrace from logging by passing stack parameter. In sentry_sdk it accepts only boolean and it's not useful in case when logging includes stack trace from other thread.

This is approach used by dogslow to report slow requests. It worked fine with raven but with sentry_sdk the stacktraces are gone, making the reports pretty much useless.

@untitaker
Copy link
Member

you can pass exc_info=True for non-exception logs to attach a stacktrace. Hope that helps

@nijel
Copy link
Contributor Author

nijel commented Oct 21, 2019

That includes stacktrace from the current thread, what is not helpful at all in this case.

@untitaker
Copy link
Member

Ah, I see what dogslow does now. So to be clear, we do not want to bring back the logging parameter specifically, for the reasons listed here: getsentry/sentry-php#844 (comment)

I believe we should have an API for sending arbitrary stacktraces. Since dogslow already had raven-specific integration I believe it would be ok if the solution includes changes in dogslow?

@nijel
Copy link
Contributor Author

nijel commented Oct 21, 2019

Yes, that should not be a problem (I'm not sure how much actively maintained the code currently is, but in worst case I can fork it).

What would be even better is ability to use also scope the from other thread, so that all request related data is collected as well.

@untitaker
Copy link
Member

untitaker commented Oct 22, 2019

What would be even better is ability to use also scope the from other thread, so that all request related data is collected as well.

If you have control over that thread you're monitoring you could take Hub.current in that thread and pass it off to your monitoring thread. Then you can call hub.capture_event() on it and all scope data will be included.

The stacktrace thing is tricky though. We have a bunch of stuff in sentry_sdk.utils that you could already cobble together (already used by the logging integration for example), but it's not stable API.

I wish there was a way to interrupt the monitored thread such that you can run the entire error capturing in the "right" thread.

nijel added a commit to WeblateOrg/weblate that referenced this issue Nov 17, 2019
It is not that useful after upgrade to sentry_sdk and it doesn't seem to
be easy to fix that.

See getsentry/sentry-python#537

Fixes #3182

Signed-off-by: Michal Čihař <michal@cihar.com>
@intgr
Copy link
Contributor

intgr commented Jul 20, 2021

FYI I have created a fork of dogslow -- dogslow-sentry -- which uses Sentry APIs and some traceback trickery to include the full stack trace, and Sentry request context, fingerprint for issue grouping, breadcrumbs etc.

https://github.com/intgr/dogslow-sentry

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants