Skip to main content

Module metrics

Module metrics 

Source
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 reason label.
incr_workspace_pinned
Increment “workspace pinned” counter for the given reason label.
incr_workspace_resumed
Increment “workspace resumed” counter for the given outcome label.
incr_workspace_stranded
Increment “workspace stranded” counter for the given reason label.
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.