SIGN IN SIGN UP

fix(metrics): handle absent values explicitly in backlog and steps-running charts (#4786)

## Description

Changes backlog and steps-running charts to handle sparse metric
responses correctly.

- Gaps shorter than three minutes are treated as missing, not as 0.
Lines connect across them without plotting a zero-valued point, and the
tooltip reports that no data was recorded.
- Displays gaps lasting at least three minutes as inferred zeroes. This
handles some of our edge cases when we stop publishing metrics from the
backend, which is most often when a backlog has been canceled so it
actually should be 0 but has not explicitly recorded as one. Separately
we should look into recording a 0 officially at this point so that we're
reporting true data.
- Updates tooltips to distinguish missing observations and inferred
zeroes from observed zeroes.

This should work with current backend that does `WITH FILL INTERPOLATE`
and after backend is updated to return absent values (since `WITH FILL
INTERPOLATE` is equivalent to there being no absent data)

### Real examples
We could have false 0s in the middle of a curve or at beginning or end
<img width="1009" height="232" alt="false zero at front"
src="https://github.com/user-attachments/assets/5dee0879-c8b3-4809-99db-8a599ae8e979"
/>
<img width="1019" height="246" alt="false zero at end2"
src="https://github.com/user-attachments/assets/3f9a30af-6e53-4ac2-8333-fd0e83f1e614"
/>
<img width="1010" height="243" alt="intermittent absent value"
src="https://github.com/user-attachments/assets/d14a1bbc-936b-4feb-84a0-b7335f08964c"
/>

### Before (synthetic data)
<img width="1003" height="510" alt="1 - no backend no frontend"
src="https://github.com/user-attachments/assets/2f14b049-9ee0-45ea-8ec2-b92bdace3675"
/>

### After (synthetic data)

We've connected over intervals of missing data that are shorter than 3
minutes, but longer ones we still infer as 0
<img width="1005" height="508" alt="4 - infer zeros for 3 min of no
data"
src="https://github.com/user-attachments/assets/2eb62aec-eb21-4d9b-821c-dacd32eadb56"
/>

We show a tooltip for no data recorded. For charts with more than one
line, we show the value for the one that is present along with absent
for the other.
<img width="1008" height="505" alt="5a - tooltip for absent"
src="https://github.com/user-attachments/assets/757145b9-6ab6-4607-a58c-e7de98a15755"
/>

<img width="1005" height="518" alt="5b - tooltip for absent"
src="https://github.com/user-attachments/assets/f3974149-4653-4689-aac6-1873fb0a76cd"
/>

If there's a trailing absent value, we just don't graph beyond the last
present value
<img width="1019" height="250" alt="Screenshot 2026-08-26 at 2 15 50 PM"
src="https://github.com/user-attachments/assets/f77fb51f-6796-47ea-9a1f-70a33f5f0fa2"
/>

## Test plan

- Unit tests cover timestamp alignment, short gaps, sustained internal
and edge gaps, empty responses, coarse granularities, and Running
metrics.

## Release note

None.

## Migration note

None.
A
albertchae committed
fbafabf6cee630e69820c24ac75aa854139ea54e
Parent: e405def
Committed by GitHub <noreply@github.com> on 8/28/2026, 4:56:17 PM