Feature request: one-directional anomaly detection alerts (high-only / low-only)
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 39.9k
- Forks
- 3.4k
- Avg merge
- 6h 51m
- Merged PRs (30d)
- 232
Description
Feature request
Summary
Let anomaly-detection alerts fire in a single direction: anomalously high or anomalously low, instead of always firing on any large deviation in either direction.
Problem
Someone with an anomaly-detection alert on a conversion-rate metric may only care when it drops, but the alert also fires when the value is anomalously high: noise they don't want to be paged on. PostHog's anomaly detectors score on the magnitude of a deviation and discard its sign, so there's no way to say "only alert me when this drops." The only escape today is to abandon the adaptive detector for a fixed threshold, which loses the whole point of anomaly detection (it won't adapt to the baseline, trend, or seasonality).
Proposed
Add a direction option to anomaly-detection alerts: both (default, current behavior), high-only, and low-only. When a direction is set, a point only counts as an anomaly if the sign of its deviation matches. The scoring is unchanged, we just gate the final fire/no-fire decision on direction. The classic fixed-threshold alert path already does this via lower
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the anomaly-detection alert evaluation and the classic fixed-threshold alert path, especially its existing lower/upper direction handling. Add the proposed both, high-only, and low-only behavior while leaving anomaly scoring unchanged; done means only deviations matching the selected direction fire, with both preserving current behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- analytics, backend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 62/100