0

I have a Flask server that is registered to sentry using raven.contrib.flask's Sentry(app, dns=...) object. I also have some python-rq workers for working on async background processes. I found this documentation that seems to state that I can just register sentry in my start_worker script like so:

with Connection(redis_client):
    worker = Worker(map(Queue, ['default']))
    client = Client('<MY_SENTRY_DSN>', transport=HTTPTransport)
    register_sentry(client, worker)
    worker.work()

Where redis_client is my connection to redis using StrictRedis(host=...). These workers work fine, but when I force the job they're working on to raise an Exception, I'm not seeing any errors on Sentry, but I am seeing the raised Exception in the worker's error logs.

My Sentry project is setup to allow all domains currently. Is there anything special I have to do to get these errors to show up correctly in Sentry?

Andrew
  • 1,890
  • 3
  • 16
  • 35
  • Should be working, unclear why it's not. I set up a demo project showing how to use Sentry with RQ, hopefully that sheds some light? https://github.com/getsentry/demo-rq – ehfeng Jun 22 '16 at 00:58
  • So the only other thing that might be causing an issue that I can think of is that we're starting the worker threads through supervisor. Otherwise I really have no idea why this isn't working correctly. – Andrew Jun 27 '16 at 14:36
  • So I stopped supervisor and ran the worker manually, but that didn't seem to make a difference. – Andrew Jun 27 '16 at 16:08
  • Can you share code (is this open source or closed?) Also did you try running my demo code? This might also be better resolved over support@getsentry.com and the final solution cross-posted here. – ehfeng Jun 29 '16 at 17:48
  • Unfortunately this is closed source. Your example gives me an error about not being able to connect to redis. `redis.exceptions.ConnectionError: Error 61 connecting to localhost:6379. Connection refused.` Even when attempting to put in the proper host for my local dockerized redis server, I get the same error. I haven't had much time to looked into this yet, however. – Andrew Jun 29 '16 at 22:02
  • Oh, but my Sentry does show that error, so that does seem to be working! – Andrew Jun 29 '16 at 22:03
  • 1
    I'll look into this more tomorrow to figure out what exactly is going on. So far it doesn't appear to be anything to do with `StrictRedis` vs `Redis`. – Andrew Jun 29 '16 at 22:08

0 Answers0