Skip to content

Commit

Permalink
Merge branch 'main' into option-to-disable-shared-libs
Browse files Browse the repository at this point in the history
  • Loading branch information
marcalff authored Oct 16, 2024
2 parents d85238c + 70ed9bc commit 0875c09
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

module(
name = "opentelemetry-cpp",
version = "1.16.1",
version = "1.17.0",
compatibility_level = 0,
repo_name = "io_opentelemetry_cpp",
)
Expand Down
4 changes: 2 additions & 2 deletions exporters/memory/src/in_memory_metric_exporter_factory.cc
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class InMemoryMetricExporter final : public sdk::metrics::PushMetricExporter
OTEL_INTERNAL_LOG_ERROR("[In Memory Metric Exporter] Exporting failed, exporter is shutdown");
return ExportResult::kFailure;
}
data_->Add(std::make_unique<ResourceMetrics>(data));
data_->Add(std::unique_ptr<ResourceMetrics>(new ResourceMetrics{data}));
return ExportResult::kSuccess;
}

Expand Down Expand Up @@ -85,7 +85,7 @@ std::unique_ptr<PushMetricExporter> InMemoryMetricExporterFactory::Create(
const std::shared_ptr<InMemoryMetricData> &data,
const AggregationTemporalitySelector &temporality)
{
return std::make_unique<InMemoryMetricExporter>(data, temporality);
return std::unique_ptr<InMemoryMetricExporter>(new InMemoryMetricExporter{data, temporality});
}

} // namespace memory
Expand Down
8 changes: 4 additions & 4 deletions exporters/memory/test/in_memory_metric_data_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ TEST(InMemoryMetricDataTest, CircularBuffer)
{
CircularBufferInMemoryMetricData buf(10);
Resource resource = Resource::GetEmpty();
buf.Add(std::make_unique<ResourceMetrics>(
&resource, std::vector<ScopeMetrics>{{nullptr, std::vector<MetricData>{}}}));
buf.Add(std::unique_ptr<ResourceMetrics>(new ResourceMetrics{
&resource, std::vector<ScopeMetrics>{{nullptr, std::vector<MetricData>{}}}}));
EXPECT_EQ((*buf.Get().begin())->resource_, &resource);
}

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

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

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

0 comments on commit 0875c09

Please sign in to comment.