Function metrics_exporter_prometheus::formatting::write_metric_line

source ยท
pub fn write_metric_line<T, T2>(
    buffer: &mut String,
    name: &str,
    suffix: Option<&'static str>,
    labels: &[String],
    additional_label: Option<(&'static str, T)>,
    value: T2
)
where T: Display, T2: Display,
Expand description

Writes a metric in the Prometheus exposition format.

When suffix is specified, it is appended to the name, which is useful for writing summary statistics, such as the sum or total of an aggregated histogram or aggregated summary. Likewise, additional_label would typically be used to specify a data type-specific label, such as le for for aggregated histograms, or quantile for aggregated summaries.