Skip to main content

Module metrics

Module metrics 

Source
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§

BackpressureMetrics
Backpressure handles (etl_backpressure_*).
CheckpointMetrics
Checkpointer handles (etl_checkpoint_* and end-to-end latency).
ComponentLabels
The standard label set attached to every framework metric.
DeserMetrics
Deserializer-stage handles (etl_deser_*).
MetricsHandle
Handle to the installed exporter. Cheap to clone.
MetricsSettings
Exporter settings, mapped from the metrics config section by the pipeline runtime. Defined here (not in config) so this module has no config dependency.
OperatorMetrics
Operator-stage handles (etl_operator_*).
PipelineMetrics
Pipeline-level handles (etl_pipeline_*).
QueueMetrics
Queue-edge handles (etl_queue_*).
SinkShardMetrics
Sink-shard handles (etl_sink_*), one struct per shard worker.
SourceMetrics
Source-stage handles (etl_source_*).

Enums§

E2eBasis
Time basis for etl_e2e_latency_seconds.
Exporter
Which exporter to install.
FlushReason
Why a sink batch was sealed and flushed.
MetricsError
Exporter installation failed.
PipelineState
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_seconds histograms and etl_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.