From dbfa36321a2985fd1ff397a99cb95ae3040a6abb Mon Sep 17 00:00:00 2001 From: Erin McNulty Date: Tue, 16 Dec 2025 13:09:23 -0500 Subject: [PATCH] SERVER-115315 Fix -Werror=subobject-linkage in metrics test util header (#45305) GitOrigin-RevId: 3923d72c3f3d09bb2ea870454a11d21fa663b969 --- src/mongo/otel/metrics/metrics_test_util.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/mongo/otel/metrics/metrics_test_util.h b/src/mongo/otel/metrics/metrics_test_util.h index 77d265c70ae..b22f0c07586 100644 --- a/src/mongo/otel/metrics/metrics_test_util.h +++ b/src/mongo/otel/metrics/metrics_test_util.h @@ -45,7 +45,7 @@ namespace mongo::otel::metrics { -namespace { +namespace test_util_detail { /** * The MetricReader is the OTel component that connects the exporter with each registered * Instrument. This implementation allows callers to trigger collection on-demand so that unit tests @@ -79,7 +79,7 @@ private: std::unique_ptr _exporter; }; -} // namespace +} // namespace test_util_detail bool isNoopMeter(opentelemetry::metrics::Meter* provider) { return !!dynamic_cast(provider); @@ -105,7 +105,7 @@ public: auto exporter = opentelemetry::exporter::memory::InMemoryMetricExporterFactory::Create( std::move(metrics)); - auto reader = std::make_shared(std::move(exporter)); + auto reader = std::make_shared(std::move(exporter)); _reader = reader.get(); std::shared_ptr provider = @@ -127,7 +127,7 @@ private: RAIIServerParameterControllerForTest _featureFlagController{"featureFlagOtelMetrics", true}; // Stash the reader so that callers can trigger on-demand metric collection. - OnDemandMetricReader* _reader; + test_util_detail::OnDemandMetricReader* _reader; // This is the in-memory data structure that holds the collected metrics. The exporter writes to // this DS, and the get() function will read from it. opentelemetry::exporter::memory::SimpleAggregateInMemoryMetricData* _metrics;