getsentry / getsentry/sentry

Metric alerts - Support equations/formulas in Metric Alerts to calculate derived metrics like failure rate

Open
#106,873 8 comments 2 reactions 0 assignees View on GitHub
2. High Product Area: Alerts Waiting for: Product Owner
Dominant language
Python
Stars
44.8k
Forks
4.9k
Avg merge
21h 10m
Merged PRs (30d)
635

Description

### Problem Statement

Currently, Metric Alerts only support single metric queries. This makes it impossible to calculate percentage-based metrics like:
- Failure rate: failed_requests / total_requests
- Error rate: errors / (errors + successes)
- Success rate: successful / total

Current Workaround Gaps
Discover: Has equations but can't query spans or custom metrics
Explore: Can query spans but no equations
Metric Alerts: Works with spans/custom metrics but only 1 metric (no equations)

Use Case
Alert on API failure rate based on HTTP status codes from mobile apps (Android/iOS). Need to avoid false positives from varying traffic volumes (day/night, week-over-week).

### Solution Brainstorm

_No response_

### Product Area

Alerts

Contributor guide

Open the contributing guide

Research direction

Start with the Metric Alerts area and compare its current single-metric behavior with the equations support described for Discover and the span-query support described for Explore. Define the scope for querying multiple metrics and calculating derived rates, then verify that API failure-rate alerts work across changing traffic volumes.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
observability-sre
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.