How does sentry aggregate events?

1,053 views
Skip to first unread message

Leo Nguyen

unread,
Jun 26, 2014, 10:18:16 PM6/26/14
to gets...@googlegroups.com
Hi all,

I'm newbie to Sentry. I'm trying out Sentry/Raven for few days. Following the document I got everything worked fine. But my Sentry seems to be weird on aggregating events. It duplicated an event many times and saved them to the database in a group. I show below my test code and some screenshots:

def get_sentry_handler():
"""
Return SentryHandler
"""
client = Client(config.SENTRY_SERVER)
handler = SentryHandler(client, level=logging.DEBUG)
return handler
for i in range(14):
log = logging.getLogger('Performance Test')
log.setLevel(logging.DEBUG)
log.addHandler(utils.get_sentry_handler())
log.error(str(uuid.uuid4().hex))
print 'OK'
time.sleep(2)
 
Sentry screenshot: 

In a group:

As you can see in the code, I sent each event (str(uuid.uuid4().hex)) just one time, but I saw many records for each event in my database. Can anyone tell me what is going on? Did I do something wrong? Or missed some configurations?
 
Currently I am using Sentry 6.4.4, Raven 4.2.3, MySQL and Redis. I started 4 Celery workers and used Apache as load balancer for 4 Sentry instances.

Thank you very much for any help!
 

David Cramer

unread,
Jun 26, 2014, 10:19:47 PM6/26/14
to gets...@googlegroups.com
Sentry doesn’t actually parse messages and try to match up similar events. What it does is take structured data and aggregate on that. This is one of many reasons why it’s not good as a log aggregator.

The general use case would involve you capturing an exception (change your example to do that), and then Sentry would aggregate based on a normalized version of the stacktrace.
--
You received this message because you are subscribed to the Google Groups "sentry" group.
To unsubscribe from this group and stop receiving emails from it, send an email to getsentry+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Leo Nguyen

unread,
Jun 26, 2014, 10:38:15 PM6/26/14
to gets...@googlegroups.com
Dear David,

Thanks a lot for your quick answer. I'm more clear now. Could you tell me why my Sentry saved a lot of records for an event? These records are duplicated.

Thanks for your help!

David Cramer

unread,
Jun 26, 2014, 10:39:15 PM6/26/14
to gets...@googlegroups.com
Because in your code you are adding a bunch of duplicate error handlers. Sentry is sending a message for each handler registered.
--

Nguyễn Thái Sơn

unread,
Jun 26, 2014, 10:44:58 PM6/26/14
to gets...@googlegroups.com
I got it. Thank you very much!



--
You received this message because you are subscribed to a topic in the Google Groups "sentry" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/getsentry/F9O7rog5UWs/unsubscribe.
To unsubscribe from this group and all its topics, send an email to getsentry+...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Thanks,
Nguyen Thai Son

Reply all
Reply to author
Forward
Message has been deleted
0 new messages