webhooker_delivery_duration_seconds is absent from a scrape until the first delivery occurs #267

Open
opened 2026-08-24 02:00:12 +02:00 by clawbot · 0 comments
Collaborator

Confirmed by execution during the review of #264: on a freshly started instance that has delivered nothing, webhooker_delivery_duration_seconds does not appear in /metrics at all (grep count 0).

initSeries in internal/metrics/metrics.go materialises every delivery counter and gauge at zero, but not deliveryDuration. The other eight webhooker_* delivery series are present from boot; this one is not.

Why it matters rather than being merely tidy: #209 exists so an operator can alert on delivery health. On a dashboard or in an alert rule, an absent series is indistinguishable from a broken exporter or a misspelled metric name — the operator cannot tell "nothing has been delivered yet" from "my monitoring is wrong". Materialising it at zero removes that ambiguity, which is the same reasoning that put the other eight in initSeries.

Narrow, and only observable before the first delivery, which is why it is not milestoned.

Definition of done:

  • deliveryDuration is materialised in initSeries for the same target-type label set the other delivery series use, so it appears from boot.
  • A test asserting webhooker_delivery_duration_seconds is present in a scrape from an instance that has delivered nothing.
  • If materialising a histogram at zero is judged wrong (a histogram with no observations is arguably not meaningful), close this with that reasoning recorded instead — but make the decision explicitly rather than leaving the inconsistency unexplained.
Confirmed by execution during the review of https://git.eeqj.de/sneak/webhooker/pulls/264: on a freshly started instance that has delivered nothing, `webhooker_delivery_duration_seconds` does not appear in `/metrics` at all (grep count 0). `initSeries` in `internal/metrics/metrics.go` materialises every delivery counter and gauge at zero, but not `deliveryDuration`. The other eight `webhooker_*` delivery series are present from boot; this one is not. Why it matters rather than being merely tidy: https://git.eeqj.de/sneak/webhooker/issues/209 exists so an operator can alert on delivery health. On a dashboard or in an alert rule, an absent series is indistinguishable from a broken exporter or a misspelled metric name — the operator cannot tell "nothing has been delivered yet" from "my monitoring is wrong". Materialising it at zero removes that ambiguity, which is the same reasoning that put the other eight in `initSeries`. Narrow, and only observable before the first delivery, which is why it is not milestoned. Definition of done: - `deliveryDuration` is materialised in `initSeries` for the same target-type label set the other delivery series use, so it appears from boot. - A test asserting `webhooker_delivery_duration_seconds` is present in a scrape from an instance that has delivered nothing. - If materialising a histogram at zero is judged wrong (a histogram with no observations is arguably not meaningful), close this with that reasoning recorded instead — but make the decision explicitly rather than leaving the inconsistency unexplained.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sneak/webhooker#267