From f63605f6e1368b03689b43733e4c5a20ff7ea1b2 Mon Sep 17 00:00:00 2001 From: Oblivion Date: Sat, 27 Aug 2022 16:18:24 +0000 Subject: [PATCH] metrics warnings --- sdk/include/opentelemetry/sdk/metrics/instruments.h | 3 ++- sdk/test/metrics/async_metric_storage_test.cc | 1 - sdk/test/metrics/metric_reader_test.cc | 1 - 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/sdk/include/opentelemetry/sdk/metrics/instruments.h b/sdk/include/opentelemetry/sdk/metrics/instruments.h index 22fdba2879..a529095600 100644 --- a/sdk/include/opentelemetry/sdk/metrics/instruments.h +++ b/sdk/include/opentelemetry/sdk/metrics/instruments.h @@ -4,6 +4,7 @@ #pragma once #ifndef ENABLE_METRICS_PREVIEW # include +# include "opentelemetry/common/macros.h" # include "opentelemetry/sdk/common/attribute_utils.h" OPENTELEMETRY_BEGIN_NAMESPACE namespace sdk @@ -61,7 +62,7 @@ struct InstrumentDescriptor using MetricAttributes = opentelemetry::sdk::common::OrderedAttributeMap; using AggregationTemporalitySelector = std::function; -static InstrumentClass GetInstrumentClass(InstrumentType type) +OPENTELEMETRY_MAYBE_UNUSED static InstrumentClass GetInstrumentClass(InstrumentType type) { if (type == InstrumentType::kCounter || type == InstrumentType::kHistogram || type == InstrumentType::kUpDownCounter) diff --git a/sdk/test/metrics/async_metric_storage_test.cc b/sdk/test/metrics/async_metric_storage_test.cc index 5f4a611a9a..e7b581aec3 100644 --- a/sdk/test/metrics/async_metric_storage_test.cc +++ b/sdk/test/metrics/async_metric_storage_test.cc @@ -97,7 +97,6 @@ TEST_P(WritableMetricStorageTestFixture, TestAggregation) std::shared_ptr collector(new MockCollectorHandle(temporality)); std::vector> collectors; collectors.push_back(collector); - size_t count_attributes = 0; opentelemetry::sdk::metrics::AsyncMetricStorage storage( instr_desc, AggregationType::kSum, new DefaultAttributesProcessor(), diff --git a/sdk/test/metrics/metric_reader_test.cc b/sdk/test/metrics/metric_reader_test.cc index 9a6f31d61c..68aac58cf1 100644 --- a/sdk/test/metrics/metric_reader_test.cc +++ b/sdk/test/metrics/metric_reader_test.cc @@ -27,7 +27,6 @@ class MockMetricReader : public MetricReader TEST(MetricReaderTest, BasicTests) { - AggregationTemporality aggr_temporality = AggregationTemporality::kDelta; std::unique_ptr metric_reader1(new MockMetricReader()); EXPECT_EQ(metric_reader1->GetAggregationTemporality(InstrumentType::kCounter), AggregationTemporality::kCumulative);