From 648f6f8981d9e6ecb271cba5b925503c0e2cf920 Mon Sep 17 00:00:00 2001 From: Gabi Davar Date: Mon, 9 Sep 2024 18:32:05 +0300 Subject: [PATCH] Add connected_clients_details back for backwards compatablity. --- exporter/clients.go | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/exporter/clients.go b/exporter/clients.go index 0fdec587..3f1a6cac 100644 --- a/exporter/clients.go +++ b/exporter/clients.go @@ -207,11 +207,23 @@ func (e *Exporter) extractConnectedClientMetrics(ch chan<- prometheus.Metric, c "Details about a connected client", clientInfoLabels, ) - e.registerConstMetricGauge( ch, "connected_client_info", 1.0, clientInfoLabelsValues..., ) + + // keep the old name for backwards compatability + e.metricDescriptions["connected_clients_details"] = newMetricDescr( + e.options.Namespace, + "connected_clients_details", + "Details about a connected client", + clientInfoLabels, + ) + e.registerConstMetricGauge( + ch, "connected_clients_details", 1.0, + clientInfoLabelsValues..., + ) + clientBaseLabels := []string{"id", "name"} clientBaseLabelsValues := []string{info.Id, info.Name} @@ -338,7 +350,7 @@ func (e *Exporter) extractConnectedClientMetrics(ch chan<- prometheus.Metric, c ch, "connected_client_output_buffer_length", float64(info.Obl), clientBaseLabelsValues..., ) - + e.metricDescriptions["connected_client_output_list_length"] = newMetricDescr( e.options.Namespace, "connected_client_output_list_length",