From 456b15a75fe0e68fbd3a802420c6ff4e18c16e34 Mon Sep 17 00:00:00 2001 From: Dan Fuhry Date: Sat, 14 Mar 2026 19:10:23 -0400 Subject: [PATCH] [metrics/metricbus] implement Add and Set on bare http counters and gauges --- metrics/metricbus/mbclient/httpserver_metrics.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/metrics/metricbus/mbclient/httpserver_metrics.go b/metrics/metricbus/mbclient/httpserver_metrics.go index 695361e..4930976 100644 --- a/metrics/metricbus/mbclient/httpserver_metrics.go +++ b/metrics/metricbus/mbclient/httpserver_metrics.go @@ -99,8 +99,8 @@ func (m *httpCounterMetric) Get() []bucket { return out } -func (m *httpCounterMetric) Add(_ float64) { - panic("unsupported") +func (m *httpCounterMetric) Add(v float64) { + m.WithLabelValues(metricbus.KV{}).Add(v) } func (m *httpCounterMetric) WithLabelValues(kv metricbus.KV) CounterMetric { @@ -151,12 +151,12 @@ func (m *httpGaugeMetric) WithLabelValues(kv metricbus.KV) GaugeMetric { return m.values[k] } -func (m *httpGaugeMetric) Set(_ float64) { - panic("unsupported") +func (m *httpGaugeMetric) Set(v float64) { + m.WithLabelValues(metricbus.KV{}).Set(v) } func (m *httpGaugeMetric) Reset() { - panic("unsupported") + m.WithLabelValues(metricbus.KV{}).Reset() } func (m *httpGaugeMetric) Get() []bucket { -- 2.52.0