From d8cf1976dae1a1892ac8faa22407ba214b5958bc Mon Sep 17 00:00:00 2001 From: Rasyid Hakim Date: Mon, 17 Jan 2022 09:37:37 +0700 Subject: [PATCH] fix: host tag got overriden --- docs/reference/metrics.md | 6 +++--- publisher/kafka.go | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/reference/metrics.md b/docs/reference/metrics.md index 50f2e56b..cd1ffcaa 100644 --- a/docs/reference/metrics.md +++ b/docs/reference/metrics.md @@ -86,21 +86,21 @@ Total number of message bytes \(including framing, such as per-Message framing a Total number of requests sent to Kafka brokers * Type: `Gauge` -* Tags: `host=broker_nodes` `broker=true` +* Tags: `broker=broker_nodes` ### `kafka_brokers_tx_bytes_total` Total number of bytes transmitted to Kafka brokers * Type: `Gauge` -* Tags: `host=broker_nodes` `broker=true` +* Tags: `broker=broker_nodes` ### `kafka_brokers_rtt_average_milliseconds` Broker latency / round-trip time in microseconds * Type: `Gauge` -* Tags: `host=broker_nodes` `broker=true` +* Tags: `broker=broker_nodes` ## Resource Usage diff --git a/publisher/kafka.go b/publisher/kafka.go index 02a43452..471d7d24 100644 --- a/publisher/kafka.go +++ b/publisher/kafka.go @@ -103,9 +103,9 @@ func (pr *Kafka) ReportStats() { rttValue := brokerStats["rtt"].(map[string]interface{}) nodeName := strings.Split(brokerStats["nodename"].(string), ":")[0] - metrics.Gauge("kafka_brokers_tx_total", brokerStats["tx"], fmt.Sprintf("host=%s,broker=true", nodeName)) - metrics.Gauge("kafka_brokers_tx_bytes_total", brokerStats["txbytes"], fmt.Sprintf("host=%s,broker=true", nodeName)) - metrics.Gauge("kafka_brokers_rtt_average_milliseconds", rttValue["avg"], fmt.Sprintf("host=%s,broker=true", nodeName)) + metrics.Gauge("kafka_brokers_tx_total", brokerStats["tx"], fmt.Sprintf("broker=%s", nodeName)) + metrics.Gauge("kafka_brokers_tx_bytes_total", brokerStats["txbytes"], fmt.Sprintf("broker=%s", nodeName)) + metrics.Gauge("kafka_brokers_rtt_average_milliseconds", rttValue["avg"], fmt.Sprintf("broker=%s", nodeName)) } default: