Skip to content

Commit f465c79

Browse files
Update pod_replica_links_lag_collector.go
1 parent 6a23ddd commit f465c79

File tree

1 file changed

+36
-7
lines changed

1 file changed

+36
-7
lines changed

internal/openmetrics-exporter/pod_replica_links_lag_collector.go

Lines changed: 36 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,17 @@
11
package collectors
22

3-
43
import (
4+
client "purestorage/fa-openmetrics-exporter/internal/rest-client"
5+
56
"github.com/prometheus/client_golang/prometheus"
6-
"purestorage/fa-openmetrics-exporter/internal/rest-client"
77
)
88

99
type PodReplicaLinksLagCollector struct {
10-
AvgLagDesc *prometheus.Desc
11-
MaxLagDesc *prometheus.Desc
10+
AvgLagDesc *prometheus.Desc
11+
MaxLagDesc *prometheus.Desc
12+
// AvgLagSecDesc & MaxLagSecDesc can be removed after 1.0.19
13+
AvgLagSecDesc *prometheus.Desc
14+
MaxLagSecDesc *prometheus.Desc
1215
Client *client.FAClient
1316
}
1417

@@ -34,20 +37,46 @@ func (c *PodReplicaLinksLagCollector) Collect(ch chan<- prometheus.Metric) {
3437
p.Lag.Max,
3538
p.Remotes[0].Name, p.LocalPod.Name, p.RemotePod.Name, p.Direction, p.Status,
3639
)
40+
// AvgLagSecDesc & MaxLagSecDesc can be removed after 1.0.19
41+
ch <- prometheus.MustNewConstMetric(
42+
c.AvgLagSecDesc,
43+
prometheus.GaugeValue,
44+
p.Lag.Avg,
45+
p.Remotes[0].Name, p.LocalPod.Name, p.RemotePod.Name, p.Direction, p.Status,
46+
)
47+
ch <- prometheus.MustNewConstMetric(
48+
c.MaxLagSecDesc,
49+
prometheus.GaugeValue,
50+
p.Lag.Max,
51+
p.Remotes[0].Name, p.LocalPod.Name, p.RemotePod.Name, p.Direction, p.Status,
52+
)
3753
}
3854
}
3955

4056
func NewPodReplicaLinksLagCollector(fa *client.FAClient) *PodReplicaLinksLagCollector {
4157
return &PodReplicaLinksLagCollector{
4258
AvgLagDesc: prometheus.NewDesc(
43-
"purefa_pod_replica_links_lag_average_sec",
44-
"FlashArray pod links average lag seconds",
59+
"purefa_pod_replica_links_lag_average_msec",
60+
"FlashArray pod links average lag in milliseconds",
4561
[]string{"remote", "local_pod", "remote_pod", "direction", "status"},
4662
prometheus.Labels{},
4763
),
4864
MaxLagDesc: prometheus.NewDesc(
65+
"purefa_pod_replica_links_lag_max_msec",
66+
"FlashArray pod links max lag in milliseconds",
67+
[]string{"remote", "local_pod", "remote_pod", "direction", "status"},
68+
prometheus.Labels{},
69+
),
70+
// AvgLagSecDesc & MaxLagSecDesc can be removed after 1.0.19
71+
AvgLagSecDesc: prometheus.NewDesc(
72+
"purefa_pod_replica_links_lag_average_sec",
73+
"FlashArray pod links average lag in milliseconds (deprecated, please use purefa_pod_replica_links_lag_average_msec)",
74+
[]string{"remote", "local_pod", "remote_pod", "direction", "status"},
75+
prometheus.Labels{},
76+
),
77+
MaxLagSecDesc: prometheus.NewDesc(
4978
"purefa_pod_replica_links_lag_max_sec",
50-
"FlashArray pod links max lag seconds",
79+
"FlashArray pod links max lag in milliseconds (deprecated, please use purefa_pod_replica_links_lag_max_msec)",
5180
[]string{"remote", "local_pod", "remote_pod", "direction", "status"},
5281
prometheus.Labels{},
5382
),

0 commit comments

Comments
 (0)