Function servers::otlp::metrics::encode_histogram

source ยท
fn encode_histogram(
    table_writer: &mut MultiTableData,
    name: &str,
    hist: &Histogram,
    resource_attrs: Option<&Vec<KeyValue>>,
    scope_attrs: Option<&Vec<KeyValue>>,
) -> Result<()>
Expand description

Encode histogram data. This function returns 3 insert requests for 3 tables.

The implementation has been following Prometheus histogram table format:

  • A %metric%_bucket table including greptime_le tag that stores bucket upper limit, and greptime_value for bucket count
  • A %metric%_sum table storing sum of samples
  • A %metric%_count table storing count of samples.

By its Prometheus compatibility, we hope to be able to use prometheus quantile functions on this table.