diff --git a/sdk/src/metrics/state/metric_collector.cc b/sdk/src/metrics/state/metric_collector.cc index cb871886a7..ba5136b375 100644 --- a/sdk/src/metrics/state/metric_collector.cc +++ b/sdk/src/metrics/state/metric_collector.cc @@ -36,10 +36,14 @@ AggregationTemporality MetricCollector::GetAggregationTemporality( InstrumentType instrument_type) noexcept { auto aggregation_temporality = metric_reader_->GetAggregationTemporality(instrument_type); - if(aggregation_temporality == AggregationTemporality::kDelta && instrument_type == InstrumentType::kGauge) { - OTEL_INTERNAL_LOG_ERROR("[MetricCollector::GetAggregationTemporality] - Error getting aggregation temporality." - << "Delta temporality for Synchronous Gauge is currently not supported, using cumulative temporality"); - + if (aggregation_temporality == AggregationTemporality::kDelta && + instrument_type == InstrumentType::kGauge) + { + OTEL_INTERNAL_LOG_ERROR( + "[MetricCollector::GetAggregationTemporality] - Error getting aggregation temporality." + << "Delta temporality for Synchronous Gauge is currently not supported, using cumulative " + "temporality"); + return AggregationTemporality::kCumulative; } return aggregation_temporality;