From 9463952e28d742d245bf37e83ce430bb19661f02 Mon Sep 17 00:00:00 2001 From: zhengbo Date: Mon, 23 Sep 2024 14:59:01 +0800 Subject: [PATCH] fix(rabbitmq): fix concurrent map error --- internal/plugins/inputs/rabbitmq/input.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/internal/plugins/inputs/rabbitmq/input.go b/internal/plugins/inputs/rabbitmq/input.go index 73b6c8dd21..bf8fbee303 100644 --- a/internal/plugins/inputs/rabbitmq/input.go +++ b/internal/plugins/inputs/rabbitmq/input.go @@ -193,7 +193,9 @@ type MetricFunc func(n *Input) func (ipt *Input) getMetric() { ipt.start = time.Now() - getFunc := []MetricFunc{getOverview, getNode, getQueues, getExchange} + // get overview first, to get cluster name + getOverview(ipt) + getFunc := []MetricFunc{getNode, getQueues, getExchange} g := goroutine.NewGroup(goroutine.Option{Name: "inputs_rabbitmq"}) for _, v := range getFunc { func(gf MetricFunc) {