Repository navigation
Description
Follow-up from #1474 (which closed #1443), filed rather than widening that PR.
What #1474 changed
The three probe-hold refusal counters collapsed onto decdn_probe_hold_unavailable_total{reason=…}.
Why this issue exists
#1443's stated motivation was that the codebase "already uses reason= labels for exactly this shape." It did not. Every other reason-style split in decdn-node fans out to sibling unlabeled counters:
| Enum | Location | Emits to |
|---|---|---|
RejectReason |
crates/node/src/dispatch.rs:76 |
dispatch_rejected_global / dispatch_rejected_per_source |
RejectLayer |
crates/node/src/rate_limit.rs:169 |
probe_rate_limit_rejected_{per_peer,per_ip,global} |
ChannelOpenFailureReason |
dispatched at crates/node/src/metrics.rs channel_open_failure_by_reason |
channel_open_failures_{insufficient_deposit,contract_revert,rpc_error} |
AnnounceReject |
crates/gossip/src/validation.rs:95 |
gossip_announces_rejected_total + gossip_messages_rejected_clock_skew |
The convention is stated deliberately in crates/node/src/metrics.rs at :214, :253 and :1086 ("One Counter per reason — like the dispatch_rejected_* convention"), and crates/gossip/src/metrics.rs:10-33 records it as a choice, not a backend limitation.
So after #1474 the crate has one labeled counter and four sibling-counter splits. The docs assert a convention that is now only half true. That is the actual inconsistency, and it should be resolved deliberately in one direction.
The decision
- Unify onto labels. Convert the four splits above to
Family<L, Counter>. Ends the fork. Cost: renames ~8 operator-facing metrics (several Mandatory in the canonical registry), touchingadr/appendix-observability.md,monitoring/prometheus-alerts.yml,monitoring/grafana-dashboard.jsonanddocs/runbook.md, plus a CHANGELOG migration entry per family. Noteappendix-observability.mdalready blesses the labeled form — its Canonical Metric Name Cross-Reference mapsgossip_messages_rejected_clock_skew→decdn_gossip_messages_rejected_total{reason="clock_skew"}, which the code implements as a sibling counter. That row is already aspirational. - Keep sibling counters as the convention and treat
probe_hold_unavailableas the documented exception (its three values genuinely share one alert and one remedy axis, which is the argument Collapse the three probe-hold counters into one {reason} label (observability) #1443 rested on). Cheapest; requires only that the:214/:253/:1086comments name the exception so the next reader doesn't have to rediscover it.
If option 1 is chosen
The mechanics are settled by #1474 and can be copied: label enum with EncodeLabelValue (the derive snake_cases variant names), a private EncodeLabelSet struct, children pre-materialized in Metrics::new() so every series still exports at zero (a Family creates children lazily — without this a dashboard shows a gap where a counter previously showed a zero), and a hand-written recorder that matches on the enum, since recorders! only reaches self.decdn.$field.
Non-negotiable either way: no metric may silently stop exporting at zero, and any alert whose remedy applies to only one reason must gain the corresponding label filter — that is what the #739/#757 split bought and what #1474 preserved via reason="exhausted".
Activity
fix: address multi-agent review findings on the two simplifications
refactor: two protocol simplifications — probe-hold reason label, ADR…
revert(cache): remove opt-in remote-origin prewarm from #1510 (#1522)
fix(node): attribute every reputation outcome to its peer (#1987) (#2001