Skip to content

Commit 88c22c8

Browse files
authored
Merge branch 'main' into migrate_semconv_weaver
2 parents 5fb6486 + 1185405 commit 88c22c8

File tree

6 files changed

+19
-15
lines changed

6 files changed

+19
-15
lines changed

MODULE.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
module(
55
name = "opentelemetry-cpp",
6-
version = "1.16.1",
6+
version = "1.17.0",
77
compatibility_level = 0,
88
repo_name = "io_opentelemetry_cpp",
99
)

exporters/memory/src/in_memory_metric_data.cc

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,9 @@ void SimpleAggregateInMemoryMetricData::Add(std::unique_ptr<ResourceMetrics> res
3131
const auto &metric = m.instrument_descriptor.name_;
3232
for (const auto &pda : m.point_data_attr_)
3333
{
34-
data_[{scope, metric}].insert({pda.attributes, pda.point_data});
34+
// NOTE: Explicit type conversion added for C++11 (gcc 4.8)
35+
data_[std::tuple<std::string, std::string>{scope, metric}].insert(
36+
{pda.attributes, pda.point_data});
3537
}
3638
}
3739
}
@@ -41,7 +43,8 @@ const SimpleAggregateInMemoryMetricData::AttributeToPoint &SimpleAggregateInMemo
4143
const std::string &scope,
4244
const std::string &metric)
4345
{
44-
return data_[{scope, metric}];
46+
// NOTE: Explicit type conversion added for C++11 (gcc 4.8)
47+
return data_[std::tuple<std::string, std::string>{scope, metric}];
4548
}
4649

4750
void SimpleAggregateInMemoryMetricData::Clear()

exporters/memory/src/in_memory_metric_exporter_factory.cc

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ class InMemoryMetricExporter final : public sdk::metrics::PushMetricExporter
4949
OTEL_INTERNAL_LOG_ERROR("[In Memory Metric Exporter] Exporting failed, exporter is shutdown");
5050
return ExportResult::kFailure;
5151
}
52-
data_->Add(std::make_unique<ResourceMetrics>(data));
52+
data_->Add(std::unique_ptr<ResourceMetrics>(new ResourceMetrics{data}));
5353
return ExportResult::kSuccess;
5454
}
5555

@@ -78,14 +78,15 @@ class InMemoryMetricExporter final : public sdk::metrics::PushMetricExporter
7878
std::unique_ptr<PushMetricExporter> InMemoryMetricExporterFactory::Create(
7979
const std::shared_ptr<InMemoryMetricData> &data)
8080
{
81-
return Create(data, [](auto) { return AggregationTemporality::kCumulative; });
81+
return Create(data,
82+
[](sdk::metrics::InstrumentType) { return AggregationTemporality::kCumulative; });
8283
}
8384

8485
std::unique_ptr<PushMetricExporter> InMemoryMetricExporterFactory::Create(
8586
const std::shared_ptr<InMemoryMetricData> &data,
8687
const AggregationTemporalitySelector &temporality)
8788
{
88-
return std::make_unique<InMemoryMetricExporter>(data, temporality);
89+
return std::unique_ptr<InMemoryMetricExporter>(new InMemoryMetricExporter{data, temporality});
8990
}
9091

9192
} // namespace memory

exporters/memory/test/in_memory_metric_data_test.cc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ TEST(InMemoryMetricDataTest, CircularBuffer)
2323
{
2424
CircularBufferInMemoryMetricData buf(10);
2525
Resource resource = Resource::GetEmpty();
26-
buf.Add(std::make_unique<ResourceMetrics>(
27-
&resource, std::vector<ScopeMetrics>{{nullptr, std::vector<MetricData>{}}}));
26+
buf.Add(std::unique_ptr<ResourceMetrics>(new ResourceMetrics{
27+
&resource, std::vector<ScopeMetrics>{{nullptr, std::vector<MetricData>{}}}}));
2828
EXPECT_EQ((*buf.Get().begin())->resource_, &resource);
2929
}
3030

@@ -45,8 +45,8 @@ TEST(InMemoryMetricDataTest, SimpleAggregate)
4545
md.instrument_descriptor.name_ = "my-metric";
4646
md.point_data_attr_.push_back(pda);
4747

48-
agg.Add(std::make_unique<ResourceMetrics>(
49-
&resource, std::vector<ScopeMetrics>{{scope.get(), std::vector<MetricData>{md}}}));
48+
agg.Add(std::unique_ptr<ResourceMetrics>(new ResourceMetrics{
49+
&resource, std::vector<ScopeMetrics>{{scope.get(), std::vector<MetricData>{md}}}}));
5050
auto it = agg.Get("my-scope", "my-metric").begin();
5151

5252
auto saved_point = opentelemetry::nostd::get<SumPointData>(it->second);

ext/test/http/CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ if(WITH_HTTP_CLIENT_CURL)
55
set(FILENAME curl_http_test)
66
add_compile_definitions(WITH_CURL)
77
add_executable(${FILENAME} ${FILENAME}.cc)
8-
target_link_libraries(${FILENAME} ${GTEST_BOTH_LIBRARIES}
8+
target_link_libraries(${FILENAME} ${GMOCK_LIB} ${GTEST_BOTH_LIBRARIES}
99
${CMAKE_THREAD_LIBS_INIT})
1010

1111
if(TARGET CURL::libcurl)
@@ -24,8 +24,8 @@ endif()
2424

2525
set(URL_PARSER_FILENAME url_parser_test)
2626
add_executable(${URL_PARSER_FILENAME} ${URL_PARSER_FILENAME}.cc)
27-
target_link_libraries(${URL_PARSER_FILENAME} ${GTEST_BOTH_LIBRARIES}
28-
${CMAKE_THREAD_LIBS_INIT} opentelemetry_api)
27+
target_link_libraries(${URL_PARSER_FILENAME} opentelemetry_api ${GMOCK_LIB}
28+
${GTEST_BOTH_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT})
2929
gtest_add_tests(
3030
TARGET ${URL_PARSER_FILENAME}
3131
TEST_PREFIX ext.http.urlparser.

test_common/src/http/client/nosend/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ if(${BUILD_TESTING})
2828
endif()
2929

3030
target_link_libraries(
31-
opentelemetry_http_client_nosend ${GTEST_BOTH_LIBRARIES} opentelemetry_ext
32-
opentelemetry_test_common)
31+
opentelemetry_http_client_nosend opentelemetry_ext
32+
opentelemetry_test_common ${GMOCK_LIB} ${GTEST_BOTH_LIBRARIES})
3333

3434
endif()

0 commit comments

Comments
 (0)