Lacking examples of error_sampler
implementations
#11021
Labels
Platform: Python
Team: Web Backend SDKs
team-web-sdk-backend
Type: Content
Issues about the contents of our docs
Core or SDK?
Platform/SDK
Which part? Which one?
Python SDK
Description
error_sampler
looks like a good feature and a perfect match for what I need, but I find myself struggling to implement it for my use case based on the docs at https://docs.sentry.io/platforms/python/configuration/sampling/#dynamically-sampling-error-events. I haven't been able to find any other implementation examples by Googling around.I have an event happening very often in production which causes a log event (not an exception raised). I want to downsample this event in particular, so I want to implement
error_sampler
, but it's hard to know how. If I need to trial-and-error my way to the correct solution I need to set up my dev environment both to connect to Sentry and produce the same condition that is happening in prod. If the docs were a bit more comprehensive or included some more examples it would help a lot.event
andhint
? Could this page link to other docs pages?hint["exc_info"][0]
to set a rate based on the exception class. In my use case I am usinglogger = logging.getLogger(__name__)
+logger.error('Special message', extra={'some': 'metadata'})
and I want to set a lower rate if I seeSpecial message
, and maybe only if the logger name matches a specific file.My not-working-properly attempt at filtering
I tried this and deployed it, but it didn't seem to decrease the number of events received in Sentry. Maybe I'm missing something obvious, or maybe it's a more subtle error, but regardless a few examples in the docs would help everyone.
Relevant:
error_sampler
option sentry-python#2456error_sampler
#8305CC @szokeasaurusrex
Suggested Solution
message
text,extra
data, timestamps, logger name, etc. The current example with exception classes is good, we just need more.event
andhint
parameters contain.The text was updated successfully, but these errors were encountered: