fn encode_histogram(
table_writer: &mut MultiTableData,
name: &str,
hist: &Histogram,
resource_attrs: Option<&Vec<KeyValue>>,
scope_attrs: Option<&Vec<KeyValue>>,
metric_ctx: &OtlpMetricCtx,
outcome: &mut MetricsIngestOutcome,
) -> Result<bool>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%_buckettable includinggreptime_letag that stores bucket upper limit, andgreptime_valuefor bucket count - A
%metric%_sumtable storing sum of samples - A
%metric%_counttable storing count of samples.
By its Prometheus compatibility, we hope to be able to use prometheus quantile functions on this table. Delta points retain their temporality tag and interval values. Bucket counts are prefix-summed within each point, never accumulated across timestamps.