Dashboards Support min/max/clamp functions in dashboard custom equations
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 44.8k
- Forks
- 4.9k
- Avg merge
- 21h 23m
- Merged PRs (30d)
- 607
Description
Problem Statement
Custom equations in dashboard widgets currently only support basic arithmetic operators. This is restrictive when building derived metrics, for example, clamping a calculated percentage to a 0–100 range, or taking the min/max of two series to build a combined health indicator.
Feedback from a customer migrating a Grafana dashboard to Sentry (application metrics + dashboards):
"The custom equations can be a bit restrictive, would be great if we could also use min/max/clamp and the likes"
Grafana and other tools support these as standard equation functions, and their absence is one of the more noticeable gaps when migrating existing dashboards over.
Solution Brainstorm
Add min(), max(), and clamp() (or equivalent bounding function) as allowed functions in the dashboard equation editor, alongside the existing arithmetic operators. This would let users combine two or more series/metrics and constrain output ranges without needing a workaround.
Product Area
Dashboards
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 locating the dashboard custom-equation editor and the code that parses or validates its allowed functions. Trace how existing arithmetic expressions are tested, then define and verify min(), max(), and clamp() behavior, including their argument requirements and expected bounds handling.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- data-visualization
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100