clang-tidy fixes

Signed-off-by: Pratik Mankawde <3397372+pratikmankawde@users.noreply.github.com>
This commit is contained in:
Pratik Mankawde
2026-06-01 14:50:54 +01:00
parent 6554f04252
commit 7aebc62223
3 changed files with 7 additions and 7 deletions

View File

@@ -94,7 +94,7 @@
auto const endpoint = get(telemetryParams, "endpoint",
"http://localhost:4318/v1/metrics");
std::string const& prefix(get(params, "prefix"));
m_collector = beast::insight::OTelCollector::New(
collector_ = beast::insight::OTelCollector::New(
endpoint, prefix, journal);
}
```

View File

@@ -268,7 +268,7 @@ private:
opentelemetry::nostd::shared_ptr<metrics_api::ObservableInstrument> m_gauge;
/** Owning collector, used to invoke hooks before reading gauge values. */
std::shared_ptr<OTelCollectorImp> m_collector;
std::shared_ptr<OTelCollectorImp> collector_;
};
//------------------------------------------------------------------------------
@@ -578,9 +578,9 @@ OTelGaugeImpl::OTelGaugeImpl(
std::string const& name,
opentelemetry::nostd::shared_ptr<metrics_api::Meter> const& meter,
std::shared_ptr<OTelCollectorImp> const& collector)
: m_gauge(meter->CreateInt64ObservableGauge(name)), m_collector(collector)
: m_gauge(meter->CreateInt64ObservableGauge(name)), collector_(collector)
{
m_collector->addGauge(this);
collector_->addGauge(this);
m_gauge->AddCallback(gaugeCallback, this);
}
@@ -588,7 +588,7 @@ void
OTelGaugeImpl::gaugeCallback(opentelemetry::metrics::ObserverResult result, void* state)
{
auto* self = static_cast<OTelGaugeImpl*>(state);
self->m_collector->callHooks();
self->collector_->callHooks();
if (auto intResult = opentelemetry::nostd::get_if<
opentelemetry::nostd::shared_ptr<opentelemetry::metrics::ObserverResultT<int64_t>>>(
&result))
@@ -600,7 +600,7 @@ OTelGaugeImpl::gaugeCallback(opentelemetry::metrics::ObserverResult result, void
OTelGaugeImpl::~OTelGaugeImpl()
{
m_gauge->RemoveCallback(gaugeCallback, this);
m_collector->removeGauge(this);
collector_->removeGauge(this);
}
void

View File

@@ -51,7 +51,7 @@ public:
// metric sources via the exported_instance Prometheus label.
std::string const instanceId = get(params, "service_instance_id");
m_collector = beast::insight::OTelCollector::New(endpoint, prefix, instanceId, journal);
collector_ = beast::insight::OTelCollector::New(endpoint, prefix, instanceId, journal);
}
// LCOV_EXCL_STOP
else