telemetry only.Expand description
What a reload says about itself, and the numbers a scrape reads.
Two halves, behind two features, because they answer to two different consumers and neither should drag in the other:
tracing— an install and a refusal each emit a structured record on the reload path, carrying the reload reason, the generation, and (on a refusal) theErrorKindand key path; a fetch from a remote store runs in adynamic_config.fetchspan with an event inside it carrying the outcome. There is nothing on the read path: reads are an atomic load and stay one.telemetry—Exposition, which renders aConfigStatusand aRemoteStatusas Prometheus text. No dependency at all, which is the whole point.
§This crate does not pick a metrics ecosystem
A library that depends on prometheus picks a fight with every
application that chose metrics, or OpenTelemetry, or nothing. So it
depends on none of them. What it offers instead is the numbers —
ConfigStatus is a handful of atomic loads and no
I/O, so an exporter may call it per scrape — and one rendering of them,
in a text format that is a wire encoding rather than a crate.
An application already running metrics or an OpenTelemetry SDK reads
status() in its own recorder and never touches this module; an
application that wants a /metrics handler and nothing else uses
Exposition and pulls in no exporter at all. Spans reach
OpenTelemetry the way every other crate’s do, through
tracing-opentelemetry, which is the application’s dependency and not
this crate’s.
§Nothing here can carry a value
A metric label is a diagnostic surface like a log line, and a scrape endpoint is usually the least guarded one a process has. So the same rule holds, one notch tighter: an event field may name a key path — that is what makes a failure actionable — and a metric label may not even do that. A path is unbounded cardinality as well as a disclosure, and a series named after a key is how one badly-labelled counter becomes a million of them.
Structs§
- Exposition
- One or more configurations’
ConfigStatus, as Prometheus text.
Constants§
- CONSECUTIVE_
FAILURES - Reloads that have installed nothing since one did.
- INSTALLS_
TOTAL - Snapshots installed since the process started.
- LAST_
FAILURE_ INFO - Always
1; theErrorKindis the label. - LAST_
FAILURE_ SECONDS - Seconds since the last reload that installed nothing.
- LAST_
RELOAD_ INFO - Always
1; the reload reason is the label. - LAST_
SUCCESS_ SECONDS - Seconds since the serving snapshot was installed.
- METRIC_
NAMES - Every metric family this crate emits, in the order
Expositionwrites them. - REMOTE_
CONSECUTIVE_ FAILURES - Fetches that returned nothing since one returned a document.
- REMOTE_
FETCHES_ TOTAL - Documents a remote source has handed over since the process started.
- REMOTE_
LAST_ FAILURE_ INFO - Always
1; theErrorKindis the label. - REMOTE_
LAST_ FETCH_ DURATION_ SECONDS - How long the last pulled fetch took, in seconds.
- REMOTE_
LAST_ FETCH_ SECONDS - Seconds since a remote source last handed one over.
- REMOTE_
METRIC_ NAMES - Every metric family a
RemoteStatusrenders as, in the orderExpositionwrites them. - REMOTE_
UP 1when the store answered the last time it was asked,0when it did not, and absent before it has been asked at all.