Skip to content

Observability

Detent exposes what you need to answer two questions: is configuration fresh? and are reads succeeding?


detent::HealthSnapshot h = client.health();
{ "initialized": true, "source_connected": true,
"accepted_version": 42, "staleness_seconds": 1.8,
"knobs": 876, "cli_overrides": 1 }

staleness_seconds is the monotonic time since the last successful update, or since construction before the first. It’s the single most useful signal: a distribution outage shows up here long before anyone notices a stale flag.

client.metrics() returns process-wide atomic counters:

CounterMeaning
reads_okSuccessful reads
reads_missingMissingKnob reads
reads_conversion_failedget_as conversion failures
snapshot_swapsAccepted updates published
refresh_failuresFailed source polls or rejected updates
stale_updatesDuplicate or older versions ignored
source_connectedCurrent source state

Labels are deliberately absent: no knob name, hash value, switch value, path or version ever becomes a metric dimension, so cardinality stays bounded and user identifiers never leak into monitoring.

  1. Staleness. staleness_seconds above refresh_alert_after (5 minutes by default). Tighten it for services whose kill switches must work within seconds.
  2. Refresh failures. refresh_failures increasing with no snapshot_swaps following.
  3. Missing reads. reads_missing above zero, unless your process already aborts on them through _or_panic.

  1. GET /v1/health on the authority.
  2. detent-authority --status and detent-agent --status from the command line.
  3. Daemon logs, described in Logging.

Hash values, switch values and knob values are never logged, and rejected publishes are logged by category without their payload. Hash and switch values are often user or tenant identifiers.