Alert - I want to combine Span counts with amount of specific error events to calculate percentage
- Dominant language
- Python
- Stars
- 44.8k
- Forks
- 4.9k
- Avg merge
- 21h 10m
- Merged PRs (30d)
- 635
Description
### Problem Statement
As of today Sentry only supports alerts specific to 1 dataset (Errors, Crash Rates, Spans, Logs) but not a combination of those.
Example use case: Redirect because of no valid Items
Based on metrics for a day:
From all the customers that redirect out of checkout because of ORDER_HAS_NO_ITEMS (mostly because of no valid delivery or stock)
15% of does not place an order after getting the error
We have around X redirect for per day( note: this values vary per day)
ORDER_HAS_NO_ITEMS is around 5,1% of all redirects
Meaning that if we look at the 15% that do not place an order = 5018,42 potential missed orders a day
In percentage of all successful calls (read: Spans) in checkout this means around 0.04% is currently redirected because of NO_ITEMS_IN_ORDER
In sentry I have access to the count of Redirect reasons on the issues dataset and I know the amount of span counts to measure total traffic but I can't combine those in 1 alert.
We would like to have an Alert if errors reach a certain threshold, preferably ratio (0.04% of all calls) if there is an error containing any of the following reasons:
- ERROR_ORDER_HAS_NO_ITEMS
- ERROR_NO_ITEMS_LEFT_IN_BASKET
Additionally we also need to support https://github.com/getsentry/sentry/issues/106873 to be able to use equations in there so I can calculate percentages.
### Solution Brainstorm
_No response_
### Product Area
Alerts
Contributor guide
Research direction
Start by reviewing the Alerts product area and issue #106873, which is cited as a prerequisite for equations. Trace how alert datasets currently handle Errors and Spans, then define the requirements for combining the specified error events with span counts and evaluating a percentage threshold. Done means the requested cross-dataset ratio alert behavior is implemented and covered by appropriate tests.
Written by the indexing model from the issue text.
Assessment
- Domain
- observability-sre
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100