getsentry / getsentry/sentry

Dashboards Support min/max/clamp functions in dashboard custom equations

Open
#120,813 3 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Feature Product Area: Dashboards
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.