From 1c85dbc9799c8f3943e82957d53cc9a3132ea4d7 Mon Sep 17 00:00:00 2001 From: Roger Coll Date: Tue, 31 Mar 2026 17:23:27 +0800 Subject: [PATCH] metrics: skip entries with empty field in Start() The id 0 "Invalid" sentinel in metrics.json has an intentionally empty field and is not marked obsolete (IDInvalid is used at runtime for bounds checking). --- metrics/metrics.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/metrics/metrics.go b/metrics/metrics.go index ac67ff236..198ff9f9c 100644 --- a/metrics/metrics.go +++ b/metrics/metrics.go @@ -49,7 +49,7 @@ func Start(meter metric.Meter) { defs := GetDefinitions() metricTypes = make(map[MetricID]MetricType, len(defs)) for _, md := range defs { - if md.Obsolete { + if md.Obsolete || md.Field == "" { continue } metricTypes[md.ID] = md.Type