Skip to content

Commit

Permalink
Add connected_clients_details back for backwards compatablity.
Browse files Browse the repository at this point in the history
  • Loading branch information
mindw committed Sep 9, 2024
1 parent 85242fe commit 648f6f8
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions exporter/clients.go
Original file line number Diff line number Diff line change
Expand Up @@ -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}

Expand Down Expand Up @@ -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",
Expand Down

0 comments on commit 648f6f8

Please sign in to comment.