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
{{ message }}
Repository navigation
refactor(node): Metrics::started() is a no-op — encode() overwrites uptime_seconds #1264
started_at is set in Metrics::new(), so the gauge is already correct without any help. The set(0) can never be observed: the only path to the value is encode(), which overwrites it first. There is exactly one caller (crates/node/src/runtime/mod.rs:456).
This is harmless today — the exported series is correct either way — but it is a method that reads as if it does something and does not. It also implies started() marks the start instant, which it does not; Metrics::new() does.
Options
Delete started() and its one call site. Metrics::new() already stamps started_at, so uptime is live from construction.
Make it real — have it re-stamp started_at, if the intent was that uptime should count from bring-up rather than from Metrics construction. Worth checking whether the gap between the two is meaningful (it spans config load and endpoint bring-up).
(1) unless someone knows a reason for (2). Either way, no exported-series change.
Acceptance
No recorder whose write is unobservable.
decdn_uptime_seconds still counts from the intended origin, with a test pinning which origin that is.
Triage note for a later run: the unresolved decision is the uptime origin. The issue must choose whether uptime starts at Metrics::new() (delete started()) or runtime bring-up (make started() re-stamp the instant), since either is defensible and changes the required test.
Activity
altanoruc commentedon Jul 17, 2026
Triage note for a later run: the unresolved decision is the uptime origin. The issue must choose whether uptime starts at
Metrics::new()(deletestarted()) or runtime bring-up (makestarted()re-stamp the instant), since either is defensible and changes the required test.refactor(node): generate the trivial metric recorders with a macro (#…
test(node): de-flake the #1264 uptime regression test
refactor(node): remove the no-op Metrics::started() recorder (#1264) (#…