Expand description
Build-gated process metrics (WS03, the metrics feature): metric_inc!/… fold
each seam into a relaxed atomic add on a process-global registry the daemon’s
Prometheus endpoint reads, and to argument-consuming no-ops (no global linked)
otherwise. The scrape-path sibling of observe; see src/metrics.rs.
Build-gated process metrics (the metrics feature) — the scrape-path sibling
of the observe shim.
observe routes seams to tracing spans/events for sampled diagnostics.
Counters do not belong there: a Prometheus counter is just a monotonic number
read at scrape time, so routing each increment through an event (callsite check,
field capture, subscriber dispatch) is all cost and no benefit — and sampling a
counter only trades that cost for an undercount you then have to scale back up.
These macros instead fold each seam into a single relaxed atomic add on a
process-global registry the metrics endpoint reads directly.
Like observe, this is off by default: with the feature off every macro
expands to an argument-consuming no-op and no global is linked (the wasm
client and any embedder that doesn’t want the counters pay nothing — verify with
cargo tree / a symbol check). The daemon (rindle-server) opts in through its
own metrics feature, which enables rindle/metrics.
§Taxonomy (WS03 metric contract; counters unless noted)
| Name | Labels | Seam |
|---|---|---|
rindle.changes.processed | kind = add/remove/edit | Graph::try_source_push |
rindle.build.ok | — | builder::build_pipeline (Ok) |
rindle.build.errors | kind | builder::build_pipeline (Err) |
rindle.push.visited | — | source_common::gen_push (index candidates) |
rindle.push.skipped | — | source_common::gen_push (index-pruned slots) |
rindle.join.probe.hit | — | Graph::push_child_change (the parent fetch ran) |
rindle.join.probe.miss | — | Graph::push_child_change (the parent fetch was skipped) |
rindle.join.precheck.disabled | reason = ineligible/observation/maintenance | the join pre-check gate (design 311 §2.5) |
The push.skipped / (push.visited + push.skipped) ratio is the guarded-fan-out
win (designs/205-GUARDED-PUSH-FANOUT-DESIGN.md §Observability); a visited that
tracks total connections flags guard extraction silently failing for a workload.
Likewise join.probe.miss / (hit + miss) is the join membership pre-check’s win
(designs/311-JOIN-MEMBERSHIP-PRECHECK-DESIGN.md §8): every miss is one reentrant
parent fetch that did not run; a rising precheck.disabled says which gate is
tripping for the workload.
Labels are &'static str only, so the series count is bounded (no per-row/-query
cardinality) — the discipline that keeps a cardinality-billed backend cheap.
Structs§
- Apply
Batch - Feature-off twin of the batch scope: a ZST with no
Drop, noInstant, no global.apply_batchis a plainfn(not a macro) so a caller in ANOTHER crate —rindle-replica’s apply loop is the one that matters — writes one unconditional line with no#[cfg]of its own and pays nothing here. - Timed