#124679·sentry

Dashboards: let an equation show as a percentage and set its decimal places

Author: sergicalCreated Sep 17, 2026Updated Sep 17, 2026
LabelsProduct Area: DashboardsFeature

What happens

A share is always an equation, and Sentry shows it as a raw number with all its decimals.

Widget query Shows Wanted
equation|100 * sum(gen_ai.usage.cache_read.input_tokens) / sum(gen_ai.usage.input_tokens) 83.6758 83.7%
equation|(sum(gen_ai.usage.input_tokens) - sum(gen_ai.usage.cache_read.input_tokens)) / count() (table column) 1,635.3072 1,635

A widget has no setting for the type or the decimal places of an equation, so the only place for "%" is the widget title. Big number thresholds work on the value, but the value still shows without "%".

The prompt cache hit rate is one of the main numbers for AI agent cost, and it is a ratio of two sums.

Expected

One or both of these:

  1. A per-column setting on a widget query for an equation: output type (number, percentage, currency, duration) and decimal places.
  2. a / b where a and b have the same type is typed as percentage and shows with the existing percentage renderer (formatPercentage in static/app/utils/discover/fieldRenderers.tsx), so users do not need 100 *.

Plain numbers from an equation get a sensible default: at most 2 decimals, or none when the value is above 100.

Steps to reproduce

  1. Send spans with gen_ai.usage.input_tokens and gen_ai.usage.cache_read.input_tokens.
  2. Make a big number widget with equation|100 * sum(gen_ai.usage.cache_read.input_tokens) / sum(gen_ai.usage.input_tokens).
  3. It shows 83.6758, with no %, and there is no setting to change this.

Related