Skip to main content

run

Function run 

Source
pub async fn run(
    node: String,
    data_dir: PathBuf,
    interval: Duration,
    metrics: Ingest<ExportMetricsServiceRequest>,
) -> Option<()>
Expand description

Sample forever, until the metrics pipeline is gone.

“Gone” in practice means aborted: this task holds an Ingest clone, so the flusher cannot close the channel underneath it while it is alive. serve_with cancels it as the first step of a stop, and the Closed arm below is what covers the other order — a flusher that stopped on its own.

The first sample waits a whole interval rather than firing at zero. A sample taken during boot is all zeroes and a free_fraction read against a directory the flushers have not touched yet; it is not wrong, it is just the least informative point in the series and it is the one a chart’s y-axis would scale to.

Errors are dropped on purpose. A shed self-sample means the node is busy storing real telemetry, which is the correct thing for it to be doing with a full queue, and a warning per interval about it would be this module making noise about its own unimportance.