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

Adding context.Context hub extractor for sentry-logrus integration #522

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

090809
Copy link

@090809 090809 commented Jan 1, 2023

Ho-ho-ho!

Problem:
When using sentry-logrus integration, it's no option for capturing events with connected traces, 'cause scopes between global sentry and hook integration isn't same.

Probably solution:
There no way to "just add hook.NewFromHub(levels, hub)", -> it will race condition.

Solution:
Adding custom extraction for sentry.Hub from current context (with using logrus.WithContext(ctx) and injected sentry.Hub to ctx via SetHubOnContext, or any middlewares, or smth else) solves this clearly.

Current change doesn't broke current API, but it gives ability for resolving explained problem.

P.S.:
Probably, test isn't clearly, but I not found any more clear solution for test this, whithout more API changing

@090809
Copy link
Author

090809 commented Jan 12, 2023

Hello, @cleptric. Any comments for this? Do I need to resolve typo, or smth else?

@cleptric
Copy link
Member

@090809 Thanks for the contribution. We are currently busy with other things but will take a look as soon as we wrap up.

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

Successfully merging this pull request may close these issues.

2 participants