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 8809641
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T02:55:36+00:00 2026-06-14T02:55:36+00:00

I am using Sentry (in a django project), and I’d like to know how

  • 0

I am using Sentry (in a django project), and I’d like to know how I can get the errors to aggregate properly. I am logging certain user actions as errors, so there is no underlying system exception, and am using the culprit attribute to set a friendly error name. The message is templated, and contains a common message (“User ‘x’ was unable to perform action because ‘y'”), but is never exactly the same (different users, different conditions).

Sentry clearly uses some set of attributes under the hood to determine whether to aggregate errors as the same exception, but despite having looked through the code, I can’t work out how.

Can anyone short-cut my having to dig further into the code and tell me what properties I need to set in order to manage aggregation as I would like?

[UPDATE 1: event grouping]

This line appears in sentry.models.Group:

class Group(MessageBase):
    """
    Aggregated message which summarizes a set of Events.
    """
    ...

    class Meta:
        unique_together = (('project', 'logger', 'culprit', 'checksum'),)
    ...

Which makes sense – project, logger and culprit I am setting at the moment – the problem is checksum. I will investigate further, however ‘checksum’ suggests that binary equivalence, which is never going to work – it must be possible to group instances of the same exception, with differenct attributes?

[UPDATE 2: event checksums]

The event checksum comes from the sentry.manager.get_checksum_from_event method:

def get_checksum_from_event(event):
    for interface in event.interfaces.itervalues():
        result = interface.get_hash()
        if result:
            hash = hashlib.md5()
            for r in result:
                hash.update(to_string(r))
            return hash.hexdigest()
    return hashlib.md5(to_string(event.message)).hexdigest()

Next stop – where do the event interfaces come from?

[UPDATE 3: event interfaces]

I have worked out that interfaces refer to the standard mechanism for describing data passed into sentry events, and that I am using the standard sentry.interfaces.Message and sentry.interfaces.User interfaces.

Both of these will contain different data depending on the exception instance – and so a checksum will never match. Is there any way that I can exclude these from the checksum calculation? (Or at least the User interface value, as that has to be different – the Message interface value I could standardise.)

[UPDATE 4: solution]

Here are the two get_hash functions for the Message and User interfaces respectively:

# sentry.interfaces.Message
def get_hash(self):
    return [self.message]

# sentry.interfaces.User
def get_hash(self):
    return []

Looking at these two, only the Message.get_hash interface will return a value that is picked up by the get_checksum_for_event method, and so this is the one that will be returned (hashed etc.) The net effect of this is that the the checksum is evaluated on the message alone – which in theory means that I can standardise the message and keep the user definition unique.

I’ve answered my own question here, but hopefully my investigation is of use to others having the same problem. (As an aside, I’ve also submitted a pull request against the Sentry documentation as part of this ;-))

(Note to anyone using / extending Sentry with custom interfaces – if you want to avoid your interface being use to group exceptions, return an empty list.)

  • 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-14T02:55:38+00:00Added an answer on June 14, 2026 at 2:55 am

    See my final update in the question itself. Events are aggregated on a combination of ‘project’, ‘logger’, ‘culprit’ and ‘checksum’ properties. The first three of these are relatively easy to control – the fourth, ‘checksum’ is a function of the type of data sent as part of the event.

    Sentry uses the concept of ‘interfaces’ to control the structure of data passed in, and each interface comes with an implementation of get_hash, which is used to return a hash value for the data passed in. Sentry comes with a number of standard interfaces (‘Message’, ‘User’, ‘HTTP’, ‘Stacktrace’, ‘Query’, ‘Exception’), and these each have their own implemenation of get_hash. The default (inherited from the Interface base class) is a empty list, which would not affect the checksum.

    In the absence of any valid interfaces, the event message itself is hashed and returned as the checksum, meaning that the message would need to be unique for the event to be grouped.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using Location.getBearing(); I seem to get randomly changing bearings. Aka, I can turn the
I got this error while migrating Sentry app in django. I am using mysql
I like using sentry classes in c++, but I seem to have a mental
I keep getting strange errors from sorl-thumbnail in my production environment (using Sentry as
Using a CSS image sprite, I'm creating an 'interactive' image where hovering over certain
using this http://bl.ocks.org/950642 we can see how to add images to nodes, the question
Using the Redis info command, I am able to get all the stats of
Using System.Diagnostics.EventLog .NET type one can programmatically create logs into the Event Viewer application.
@using(Html.BeginForm(About, User, FormMethod.Post , new { id=aboutme})) { <fieldset> <ul> <li> <label class=block>About me</label>
I am working on building a web-application using Django. Since I'm new to working

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.