Skip to main content

Module observability

Module observability 

Source
Expand description

Pipeline-internal observability: tracing spans and metrics counters/ histograms wired automatically around every source, sink, transform, and state-store operation. See docs/superpowers/specs/2026-05-23-observability-otel-prometheus-design.md.

Structs§

DurationGuard
On Drop, records the elapsed time since construction into the named histogram with the supplied labels. Recording on drop guarantees a sample even if the surrounding future is cancelled or panics.
InstallReport
Report from install_observability so callers can log what actually happened (recorder installed vs. already-installed vs. disabled).
InstrumentedSink
Wraps a &dyn Sink (or any &S: Sink) and emits spans + metrics around write_batch and flush. Constructed by Pipeline::run.
InstrumentedSource
Wraps a &dyn Source (or any &S: Source) and emits spans + metrics around every call. Constructed by Pipeline::run and never exposed to end users; the wrapped source remains the user-facing object.
InstrumentedStateStore
Wraps an Arc<dyn StateStore> and emits faucet.state.* spans + metrics around every operation.
Labels
Common labels carried by every span and metric.
ObservabilityConfig
Configuration for install_observability. Either or both sections may be None; unset sections install nothing.
PrometheusConfig
RunStreamOptions
TracingConfig

Enums§

InstallError

Functions§

install_observability
Install observability if requested. Always returns; never panics.
instrumented_apply_qualityquality
Apply the quality pass and emit metrics. Returns the same outcome as apply_quality; on abort, increments faucet_quality_aborts_total before propagating the error.
instrumented_apply_stages
Apply a sequence of compiled stages to every record in records, flat-mapping per stage. Emits one faucet.transform.apply span and counters faucet_transform_records_in_total / _records_out_total per call (per page).
register_build_info
Register the faucet_build_info{version} gauge (set to 1) under the currently-installed metrics recorder. Safe to call from any code path that wants to ensure the gauge is set; install_observability invokes this automatically. Gauges are naturally idempotent under the metrics model — repeat calls just re-set the same value.
strip_type_name
Strip a Rust type_name string to its final path segment.
update_bookmark_lag
Update the bookmark-lag gauges if the bookmark is a parseable RFC3339 timestamp. Returns true if the gauges were updated, false otherwise.