Expand description
Metrics: exporter installation and pre-registered handle structs for every pipeline stage.
etl-rs instruments through the [metrics] facade — pipeline authors
register custom metrics with the same macros and they are exported
alongside the framework’s. install wires the exporter selected by
configuration; the taxonomy contract lives in docs/METRICS.md and its
names in names.
§One pipeline per process
The exporter installs a process-global recorder (the metrics
facade has one global recorder), matching the framework’s
one-pipeline-per-process deployment model. install therefore
succeeds at most once per process; a second call returns
MetricsError::AlreadyInstalled.
§Hot-path discipline
All handles are pre-registered at pipeline build time via the structs in
this module (SourceMetrics, SinkShardMetrics, …). The record
loop only ever touches resolved Counter/Gauge/Histogram handles,
and methods take per-batch aggregates.
Modules§
- names
- Metric and label name constants — the single source of truth for the
taxonomy documented in
docs/METRICS.md.
Structs§
- Backpressure
Metrics - Backpressure handles (
etl_backpressure_*). - Checkpoint
Metrics - Checkpointer handles (
etl_checkpoint_*and end-to-end latency). - Component
Labels - The standard label set attached to every framework metric.
- Deser
Metrics - Deserializer-stage handles (
etl_deser_*). - Metrics
Handle - Handle to the installed exporter. Cheap to clone.
- Metrics
Settings - Exporter settings, mapped from the
metricsconfig section by the pipeline runtime. Defined here (not inconfig) so this module has no config dependency. - Operator
Metrics - Operator-stage handles (
etl_operator_*). - Pipeline
Metrics - Pipeline-level handles (
etl_pipeline_*). - Queue
Metrics - Queue-edge handles (
etl_queue_*). - Sink
Shard Metrics - Sink-shard handles (
etl_sink_*), one struct per shard worker. - Source
Metrics - Source-stage handles (
etl_source_*).
Enums§
- E2eBasis
- Time basis for
etl_e2e_latency_seconds. - Exporter
- Which exporter to install.
- Flush
Reason - Why a sink batch was sealed and flushed.
- Metrics
Error - Exporter installation failed.
- Pipeline
State - Lifecycle state of the pipeline, exported via
etl_pipeline_state.
Constants§
- BATCH_
BYTES_ BUCKETS - Buckets for
etl_sink_batch_bytes(powers of 4, 4 KiB .. 256 MiB). - BATCH_
ROWS_ BUCKETS - Buckets for
etl_sink_batch_rows(powers of 4, 64 .. 1Mi rows). - DURATION_
SECONDS_ BUCKETS - Buckets for
*_duration_secondshistograms andetl_e2e_latency_seconds(1 ms .. 60 s, roughly exponential).
Functions§
- install
- Install the configured exporter as this process’s global recorder and return the handle the admin server renders from.