You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
## Summary
Emit how long a break went undetected: when a validation build fails,
record the elapsed time from the commit timestamp of the base it
validated against, as a histogram tagged with the queue and the build
strategy. A histogram rather than a gauge because the distribution over
failures is the point — what an operator wants is how long a break
typically survives, not how long the last one did. The buckets
(`ChangeAgeBuckets`) span minutes to a month, since a break caught in
minutes and one that survived a fortnight are both ordinary
observations.
The observation lives in `buildsignal`, the stage that records the
failure. A failure is the moment a break becomes known, and an elapsed
time is only meaningful against it, so unlike the last-known-green age
in #572 there is no later moment to sample it from — it cannot be moved
off the delivery path onto the periodic schedule. The cost is a
source-control call on that path, so it is confined to failures, made
after the outcome is durable, and swallows every fault: a failed
observation is counted with the step that failed and never disturbs the
outcome already written.
A full build pins no base commit, so its failures have nothing to
measure from. That is the ordinary case for the strategy rather than a
fault, so those failures are counted as unmeasurable
(`detection_missing`) instead of landing in the error series.
Rebased onto the restructured #572, so the emits follow the same
conventions as the last-green observation there: an operation name for
what is measured rather than for the stage, `detection_errors` tagged
with the step that failed, a separate counter for "nothing to measure",
and failures logged. The source-control factory is a required
constructor dependency and wired in `service/stovepipe/server/main.go`.
## Test Plan
- `make test` — table-driven unit tests cover the measured path, the
no-baseline (full build) case, and every step that can fail to observe:
source control not resolving, `ChangeInfo` failing, an undated change,
and a change dated in the future.
- `make lint`, `make check-gazelle`, `make check-tidy`, `make build`.
- Deploy and add a query for `build_failure.time_to_detection`,
confirming `detection_errors` stays flat and `detection_missing` tracks
only full-build failures.
## Issues
## Stack
1. #572
1. @ #573
0 commit comments