From 213b73bdc4e6ec7df48be7d53029760ab506749f Mon Sep 17 00:00:00 2001 From: Leonardo Parente Date: Mon, 17 Apr 2023 16:26:47 -0400 Subject: [PATCH] Add AggregationTemporality Cumulative to OTLP histogram metric --- src/Metrics.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Metrics.h b/src/Metrics.h index c324d1082..2dc50041e 100644 --- a/src/Metrics.h +++ b/src/Metrics.h @@ -312,7 +312,9 @@ class Histogram final : public Metric auto metric = scope.add_metrics(); metric->set_name(base_name_snake()); metric->set_description(_desc); - auto hist_data_point = metric->mutable_histogram()->add_data_points(); + auto m_hist = metric->mutable_histogram(); + m_hist->set_aggregation_temporality(metrics::v1::AggregationTemporality::AGGREGATION_TEMPORALITY_CUMULATIVE); + auto hist_data_point = m_hist->add_data_points(); hist_data_point->set_start_time_unix_nano(timespec_to_uint64(start)); hist_data_point->set_time_unix_nano(timespec_to_uint64(end));