From a16a176d21ec60f634588d754ff4a8e423a7b615 Mon Sep 17 00:00:00 2001 From: Shourie Ganguly Date: Wed, 6 Nov 2024 23:47:07 +0530 Subject: [PATCH] updated metrics.Close() logic to help with tests failing --- x-pack/filebeat/input/gcs/metrics.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/x-pack/filebeat/input/gcs/metrics.go b/x-pack/filebeat/input/gcs/metrics.go index 323f261543a..1606cb111f1 100644 --- a/x-pack/filebeat/input/gcs/metrics.go +++ b/x-pack/filebeat/input/gcs/metrics.go @@ -71,13 +71,12 @@ func newInputMetrics(id string, optionalParent *monitoring.Registry) *inputMetri Register("histogram", metrics.NewHistogram(out.sourceLagTime)) //nolint:errcheck // A unique namespace is used so name collisions are impossible. // set the URL of the input resource. Id is the bucket name. - if id != "" { - out.url.Set("gs://" + id) - } + out.url.Set("gs://" + id) return out } func (m *inputMetrics) Close() { + m.url.Clear() m.unregister() }