Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8208625
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T09:26:16+00:00 2026-06-07T09:26:16+00:00

I’m trying to setup raven to log to sentry asynchronously using celery. I think

  • 0

I’m trying to setup raven to log to sentry asynchronously using celery. I think I’ve set things up correctly, but but the send_raw functions in the CeleryClient are not being called (and nothing is being picked up in sentry or celery). Things work if I don’t change the SENTRY_CLIENT setting below (the logs appear in sentry). My setting are:

SENTRY_CLIENT = 'raven.contrib.django.celery.CeleryClient'

Installed apps:

'raven.contrib.django',    
# sentry.client.celery should be replaced with raven.contrib.django.celery in INSTALLED_APPS.    
'raven.contrib.django.celery',    

Logging:

LOGGING = {
    'version': 1,
    'disable_existing_loggers': True,
    'root': {
        'level': 'WARNING', # anything warning or above will go to sentry...
        'handlers': ['sentry'], # TARAS this is what sends all errors to Sentry
    },
    'formatters': {
        'verbose': {
            'format': '%(levelname)s %(asctime)s %(module)s %(process)d %(thread)d %(message)s'
        },
    },
    'handlers': {
        'sentry': {
            'level': 'ERROR',
            'class': 'raven.contrib.django.handlers.SentryHandler', # this is what communicates to Sentry
        },
        'console': {
            'level': 'DEBUG',
            'class': 'logging.StreamHandler',
            'formatter': 'verbose'
        }
    },
    'loggers': {
        'django.db.backends': {
            'level': 'ERROR',
            'handlers': ['console'],
            'propagate': False,
        },
        'raven': {
            'level': 'DEBUG',
            # class logging.StreamHandler(stream=None)
            # Returns a new instance of the StreamHandler class. If stream is specified, the instance will use it for logging output; otherwise, sys.stderr will be used.            
            'handlers': ['sentry'], # sentry hits sentry configuration above, console by default according to the above definition of streamhandler hits stderr
            'propagate': False,
        },
        'sentry.errors': {
            'level': 'DEBUG',
            'handlers': ['console'],
            'propagate': False,
        },
    },
}

I have modified CeleryClient to

class CeleryClient(CeleryMixin, DjangoClient):
    def send_integrated(self, kwargs):
        self.send_raw_integrated.delay(kwargs)
        print "yo"

    @task(routing_key='sentry')
    def send_raw_integrated(self, kwargs):
        super(CeleryClient, self).send_integrated(kwargs)
        print "yo2"

And the traces don’t come out

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T09:26:17+00:00Added an answer on June 7, 2026 at 9:26 am

    The celery client in raven uses a routing key on the task:

    class CeleryMixin(object):
        def send_encoded(self, *args, **kwargs):
            "Errors through celery"
            self.send_raw.delay(*args, **kwargs)
    
        @task(routing_key='sentry')
        def send_raw(self, *args, **kwargs):
            return super(CeleryMixin, self).send_encoded(*args, **kwargs)
    

    Django by default uses a direct exchange type:

    http://docs.celeryproject.org/en/latest/userguide/routing.html

    Which means (I believe) that the messages produced by celery will not be routed to a queue (and thus will never be picked up).

    You can define this, for example:

    CELERY_QUEUES = {
        "default": {
            "exchange": "default",
            "binding_key": "default"},
        "sentry": {
            "exchange": "default",
            "binding_key": "sentry"},
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I want to count how many characters a certain string has in PHP, but
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I am reading a book about Javascript and jQuery and using one of the
I am trying to render a haml file in a javascript response like so:
I have a French site that I want to parse, but am running into

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.