Hi!
I am trying to add some extra context to Sentry in my Celery task. I configured Celery according to https://docs.sentry.io/clients/python/integrations/celery/#setup (second version with celery.Celery base class), with one update – I stored raven client in self.raven_client instead of local var client.
Then I have custom Celery Task class, and inside run method I have something like this:
raven_client = self.app.raven_client
# several dummy values, just for test
raven_client.extra_context({'chleba': 'maslo'})
raven_client.user_context({'koza': 'roza'})
raven_client.http_context({'libor': 'milos'})
raven_client.tags_context({'jara': 'mara'})
I restart celery workers, run my task, receive message in Sentry, and found that just tags was captured (no extra info about user or in “Aditional data” section). So I begin with debugging. I trace whole path from my celery task up to Raven’s Client object. In all relevant places, context contain all of my extra informations (extra, user, …). Then message was send and when I checked Sentry interface again, I could see all of my extra informations
I was quite surprised, because I just add debuggers (from celery.contrib import rdb; rdb.set_trace()) on several places, nothing else.
So I remove debuggers, run my task once again, and Sentry shows me again just tags (no extra data in additional or user section):
There are several strange things:
- tags are on right side only, or also on top of the page
- there is some error box on top of page
- there is different exception “stack” (last item is protected_call or trace_task)
I really don’t understand what is happening here. Do you have any explanation please?