Expand description
In-process counters and gauges for workspace lifecycle (Epic B).
Follows the same pattern as dk-protocol/src/metrics.rs: per-label counters
backed by tracing::info! events with a metric field so log-based
aggregators can surface them. Each labeled counter family is stored in a
DashMap<String, AtomicU64> so a future Prometheus exporter can iterate
over all observed label values. The gauge remains a plain AtomicI64
because it has no label dimension.
Functions§
- incr_
workspace_ abandoned - Increment “workspace abandoned” counter for the given
reasonlabel. - incr_
workspace_ pinned - Increment “workspace pinned” counter for the given
reasonlabel. - incr_
workspace_ resumed - Increment “workspace resumed” counter for the given
outcomelabel. - incr_
workspace_ stranded - Increment “workspace stranded” counter for the given
reasonlabel. - set_
workspace_ stranded_ active - Set the stranded-active gauge to
n(COUNT(*) WHERE stranded_at IS NOT NULL AND abandoned_at IS NULL). - workspace_
abandoned_ total - Total abandoned events across all reason labels.
- workspace_
pinned_ total - Total pinned events across all reason labels.
- workspace_
resumed_ total - Total resumed events across all outcome labels.
- workspace_
stranded_ active - workspace_
stranded_ total - Total stranded events across all reason labels.