@@ -64,7 +64,7 @@ metric_sdk::AggregationType OtlpMetricUtils::GetAggregationType(
6464 return metric_sdk::AggregationType::kHistogram ;
6565 }
6666 else if (nostd::holds_alternative<sdk::metrics::Base2ExponentialHistogramPointData>(
67- point_data_with_attributes.point_data ))
67+ point_data_with_attributes.point_data ))
6868 {
6969 return metric_sdk::AggregationType::kBase2ExponentialHistogram ;
7070 }
@@ -183,8 +183,8 @@ void OtlpMetricUtils::ConvertHistogramMetric(
183183}
184184
185185void OtlpMetricUtils::ConvertExponentialHistogramMetric (
186- const metric_sdk::MetricData &metric_data,
187- proto::metrics::v1::ExponentialHistogram *const histogram) noexcept
186+ const metric_sdk::MetricData &metric_data,
187+ proto::metrics::v1::ExponentialHistogram *const histogram) noexcept
188188{
189189 histogram->set_aggregation_temporality (
190190 GetProtoAggregationTemporality (metric_data.aggregation_temporality ));
@@ -196,45 +196,43 @@ void OtlpMetricUtils::ConvertExponentialHistogramMetric(
196196 histogram->add_data_points ();
197197 proto_histogram_point_data->set_start_time_unix_nano (start_ts);
198198 proto_histogram_point_data->set_time_unix_nano (ts);
199- auto histogram_data =
200- nostd::get<sdk::metrics::Base2ExponentialHistogramPointData>( point_data_with_attributes.point_data );
199+ auto histogram_data = nostd::get<sdk::metrics::Base2ExponentialHistogramPointData>(
200+ point_data_with_attributes.point_data );
201201 // sum
202202 proto_histogram_point_data->set_sum (histogram_data.sum_ );
203203 proto_histogram_point_data->set_count (histogram_data.count_ );
204204 if (histogram_data.record_min_max_ )
205205 {
206- proto_histogram_point_data->set_min (histogram_data.min_ );
207- proto_histogram_point_data->set_max (histogram_data.max_ );
206+ proto_histogram_point_data->set_min (histogram_data.min_ );
207+ proto_histogram_point_data->set_max (histogram_data.max_ );
208208 }
209209 // negative buckets
210- if (!histogram_data.negative_buckets_ .Empty ())
210+ if (!histogram_data.negative_buckets_ .Empty ())
211211 {
212212 auto negative_buckets = proto_histogram_point_data->mutable_negative ();
213213 negative_buckets->set_offset (histogram_data.negative_buckets_ .StartIndex ());
214214
215- for ( auto index = histogram_data.negative_buckets_ .StartIndex ();
216- index <= histogram_data.negative_buckets_ .EndIndex (); ++index)
215+ for ( auto index = histogram_data.negative_buckets_ .StartIndex ();
216+ index <= histogram_data.negative_buckets_ .EndIndex (); ++index)
217217 {
218- negative_buckets->add_bucket_counts (histogram_data.negative_buckets_ .Get (index));
218+ negative_buckets->add_bucket_counts (histogram_data.negative_buckets_ .Get (index));
219219 }
220220 }
221221 // positive buckets
222- if (!histogram_data.positive_buckets_ .Empty ())
222+ if (!histogram_data.positive_buckets_ .Empty ())
223223 {
224224 auto positive_buckets = proto_histogram_point_data->mutable_positive ();
225225 positive_buckets->set_offset (histogram_data.positive_buckets_ .StartIndex ());
226226
227- for ( auto index = histogram_data.positive_buckets_ .StartIndex ();
228- index <= histogram_data.positive_buckets_ .EndIndex (); ++index)
227+ for ( auto index = histogram_data.positive_buckets_ .StartIndex ();
228+ index <= histogram_data.positive_buckets_ .EndIndex (); ++index)
229229 {
230230 positive_buckets->add_bucket_counts (histogram_data.positive_buckets_ .Get (index));
231231 }
232232 }
233233 proto_histogram_point_data->set_scale (histogram_data.scale_ );
234234 proto_histogram_point_data->set_zero_count (histogram_data.zero_count_ );
235235
236-
237-
238236 // attributes
239237 for (auto &kv_attr : point_data_with_attributes.attributes )
240238 {
@@ -244,7 +242,6 @@ void OtlpMetricUtils::ConvertExponentialHistogramMetric(
244242 }
245243}
246244
247-
248245void OtlpMetricUtils::ConvertGaugeMetric (const opentelemetry::sdk::metrics::MetricData &metric_data,
249246 proto::metrics::v1::Gauge *const gauge) noexcept
250247{
0 commit comments