@@ -102,13 +102,13 @@ func NewNginxPlusCollector(nginxClient *plusclient.NginxClient, namespace string
102
102
"health_checks_unhealthy" : newStreamUpstreamServerMetric (namespace , "health_checks_unhealthy" , "How many times the server became unhealthy (state 'unhealthy')" ),
103
103
},
104
104
streamZoneSyncMetrics : map [string ]* prometheus.Desc {
105
- "bytes_in" : newStreamZoneSyncMetric (namespace , "bytes_in" , "Bytes received by this zone " ),
106
- "bytes_out" : newStreamZoneSyncMetric (namespace , "bytes_out" , "Bytes sent by this zone " ),
107
- "msgs_in" : newStreamZoneSyncMetric (namespace , "msgs_in" , "Total messages received by ths zone " ),
108
- "msgs_out" : newStreamZoneSyncMetric (namespace , "msgs_out" , "Total messages sent by this zone " ),
105
+ "bytes_in" : newStreamZoneSyncMetric (namespace , "bytes_in" , "Bytes received by this node " ),
106
+ "bytes_out" : newStreamZoneSyncMetric (namespace , "bytes_out" , "Bytes sent by this node " ),
107
+ "msgs_in" : newStreamZoneSyncMetric (namespace , "msgs_in" , "Total messages received by this node " ),
108
+ "msgs_out" : newStreamZoneSyncMetric (namespace , "msgs_out" , "Total messages sent by this node " ),
109
109
"nodes_online" : newStreamZoneSyncMetric (namespace , "nodes_online" , "Number of peers this node is conected to" ),
110
- "records_pending" : newStreamZoneSyncZonesMetric (namespace , "records_pending" , "The number of records that need to be sent to the cluster" ),
111
- "records_total" : newStreamZoneSyncZonesMetric (namespace , "records_total" , "The total number of records stored in the shared memory zone" ),
110
+ "records_pending" : newStreamZoneSyncZoneMetric (namespace , "records_pending" , "The number of records that need to be sent to the cluster" ),
111
+ "records_total" : newStreamZoneSyncZoneMetric (namespace , "records_total" , "The total number of records stored in the shared memory zone" ),
112
112
},
113
113
upMetric : newUpMetric (namespace ),
114
114
}
@@ -305,9 +305,9 @@ func (c *NginxPlusCollector) Collect(ch chan<- prometheus.Metric) {
305
305
306
306
for name , zone := range stats .StreamZoneSync .Zones {
307
307
ch <- prometheus .MustNewConstMetric (c .streamZoneSyncMetrics ["records_pending" ],
308
- prometheus .CounterValue , float64 (zone .RecordsPending ), name )
308
+ prometheus .GaugeValue , float64 (zone .RecordsPending ), name )
309
309
ch <- prometheus .MustNewConstMetric (c .streamZoneSyncMetrics ["records_total" ],
310
- prometheus .CounterValue , float64 (zone .RecordsTotal ), name )
310
+ prometheus .GaugeValue , float64 (zone .RecordsTotal ), name )
311
311
}
312
312
313
313
ch <- prometheus .MustNewConstMetric (c .streamZoneSyncMetrics ["bytes_in" ],
@@ -319,7 +319,7 @@ func (c *NginxPlusCollector) Collect(ch chan<- prometheus.Metric) {
319
319
ch <- prometheus .MustNewConstMetric (c .streamZoneSyncMetrics ["msgs_out" ],
320
320
prometheus .CounterValue , float64 (stats .StreamZoneSync .Status .MsgsOut ))
321
321
ch <- prometheus .MustNewConstMetric (c .streamZoneSyncMetrics ["nodes_online" ],
322
- prometheus .CounterValue , float64 (stats .StreamZoneSync .Status .NodesOnline ))
322
+ prometheus .GaugeValue , float64 (stats .StreamZoneSync .Status .NodesOnline ))
323
323
}
324
324
325
325
var upstreamServerStates = map [string ]float64 {
@@ -359,6 +359,6 @@ func newStreamZoneSyncMetric(namespace string, metricName string, docString stri
359
359
return prometheus .NewDesc (prometheus .BuildFQName (namespace , "stream_zone_sync_status" , metricName ), docString , nil , nil )
360
360
}
361
361
362
- func newStreamZoneSyncZonesMetric (namespace string , metricName string , docString string ) * prometheus.Desc {
363
- return prometheus .NewDesc (prometheus .BuildFQName (namespace , "stream_zone_sync " , metricName ), docString , []string {"server_zone " }, nil )
362
+ func newStreamZoneSyncZoneMetric (namespace string , metricName string , docString string ) * prometheus.Desc {
363
+ return prometheus .NewDesc (prometheus .BuildFQName (namespace , "stream_zone_sync_zone " , metricName ), docString , []string {"zone " }, nil )
364
364
}
0 commit comments