question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Adding user context for RQ doesn't seem to work when having multiple integrations

See original GitHub issue

I assume that it should be possible to define multiple integrations like so?

sentry_sdk.init(
        dsn='...',
        environment='...',
        integrations=[
            FlaskIntegration(), RqIntegration()
        ]
)

This do work when exceptions occur in RQ, but none of the data that we set through configure_scope() like this are sent:

with configure_scope() as scope:
    scope.user = {'email': 'stian@e5r.no'}

We use gevent and Flask-RQ. I debugged the scope inside the RQ process before the exception occurr and the scope has _name = 'flask'

The user context is sent if I don’t specify multiple integrations during setup. The code is like this then, but this can’t be the way it should be?

sentry_sdk.init(
        dsn='...',
        environment='...',
        integrations=[
            FlaskIntegration() if 'rq' not in sys.argv else RqIntegration()
        ]
)

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:18 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
stianprcommented, Jun 17, 2019

@untitaker I’ll make a pull request instead. It might be easier for everyone that I use a fork and try to debug to find the issue.

I think the issue might have something to do with how “shared” scope works between the different integrations. Hopefully I will find out by the end of this week. I’ll let you know of any updates.

0reactions
untitakercommented, Nov 2, 2020

I’m closing this again as the investigation along this is going very slowly and we’re on 0.19 by now.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to propagate errors in python rq worker tasks to Sentry
Now I created some tasks with rq , but their errors do not show up in Sentry Issues stream. I can tell the...
Read more >
The Flask Mega-Tutorial Part XXII: Background Jobs
This is the twenty second installment of the Flask Mega-Tutorial series, in which I'm going to tell you how to create background jobs...
Read more >
RQ – Simple Job Queues for Python - Hacker News
When I wanted to add processing for background jobs to a Django project, the most obvious solution was Celery, and the most obvious...
Read more >
Running background tasks with Flask and RQ
What do we need to integrate RQ in our Flask web app? Let's first add some variables in app/settings.py : # The Redis...
Read more >
gwyddion-user-guide-en.pdf
The path to the Add/Remove window may be slightly different on other Windows OS. ... It is the main widget used for working...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found