feat(examples): window ci pass rate to 30d to match delivery rate

pilot_ci_runs_total is a lifetime hydrated counter, so the gauge read
all-time (92.8%). Window it to 30d with max_over_time - min_over_time
(the hydrated-counter pattern used across this config) for the honest
94.8%; increase() would inflate to 96.3% by re-adding the hydration base
on each of the 5 restart dips/30d. Pilot exposes no pilot_window_ci_*
gauge, so this is a client-side window; note in-config that true parity
would need a server-computed gauge from Pilot.
This commit is contained in:
Aleks Petrov committed 2026-08-06 15:41:48 +02:00
1 parent 55badff1d7
commit eeee2f56eb
1 file changed
+13 -4
+13 -4
View File
@@ -90,7 +90,7 @@ widgets:
# ci pass rate | pipeline latency
# success by model | cost by model
- type: gauge
title: ci pass rate
title: ci pass rate (30d)
unit: percentunit
min: 0
max: 1
@@ -102,9 +102,18 @@ widgets:
- value: 0.95
color: green
queries:
# pilot_ci_runs_total{result} shipped in pilot#4134 — this replaces the
# old merged/(merged+failed) "pr delivery" proxy gauge.
- expr: sum(pilot_ci_runs_total{result="pass"}) / (sum(pilot_ci_runs_total) > 0)
# pilot_ci_runs_total{result} shipped in pilot#4134. Windowed to 30d to
# match the delivery-rate card. Unlike delivery rate, Pilot exposes NO
# server-computed CI window gauge (the pilot_window_* family is
# delivery/attempt/cost only), so this is a client-side window using
# max_over_time - min_over_time, NOT increase(): pilot_ci_runs_total is
# store-hydrated and dips on restart (5 resets/30d, min never reaches 0),
# so increase() reads each hydration dip as a reset and re-adds the base,
# inflating the ratio (96.3% vs the honest 94.8%). max-min never adds the
# base; worst case it undercounts a restart-straddling window. See the
# prs/3h card note. For true parity with delivery rate, Pilot would need a
# pilot_window_ci_pass_rate gauge (dispatch, cf. pilot#4735).
- expr: sum(max_over_time(pilot_ci_runs_total{result="pass"}[30d]) - min_over_time(pilot_ci_runs_total{result="pass"}[30d])) / (sum(max_over_time(pilot_ci_runs_total[30d]) - min_over_time(pilot_ci_runs_total[30d])) > 0)
# Four same-unit series overlaid (first fills as area, later ones draw as
# lines). 1h windows: each point is the mean over events in that hour; gaps