mirror of
https://github.com/openfaas/faas.git
synced 2025-06-24 15:53:26 +00:00
Renamed ServiceReplicasCounter to ServiceReplicasGauge
To avoid future confusion, this fix renames ServiceReplicasCounter to ServiceReplicasGauge. Signed-off-by: Ken Fukuyama <kenfdev@gmail.com>
This commit is contained in:
@ -35,7 +35,7 @@ func NewExporter(options MetricOptions) *Exporter {
|
||||
func (e *Exporter) Describe(ch chan<- *prometheus.Desc) {
|
||||
e.metricOptions.GatewayFunctionInvocation.Describe(ch)
|
||||
e.metricOptions.GatewayFunctionsHistogram.Describe(ch)
|
||||
e.metricOptions.ServiceReplicasCounter.Describe(ch)
|
||||
e.metricOptions.ServiceReplicasGauge.Describe(ch)
|
||||
}
|
||||
|
||||
// Collect collects data to be consumed by prometheus
|
||||
@ -43,13 +43,13 @@ func (e *Exporter) Collect(ch chan<- prometheus.Metric) {
|
||||
e.metricOptions.GatewayFunctionInvocation.Collect(ch)
|
||||
e.metricOptions.GatewayFunctionsHistogram.Collect(ch)
|
||||
|
||||
e.metricOptions.ServiceReplicasCounter.Reset()
|
||||
e.metricOptions.ServiceReplicasGauge.Reset()
|
||||
for _, service := range e.services {
|
||||
e.metricOptions.ServiceReplicasCounter.
|
||||
e.metricOptions.ServiceReplicasGauge.
|
||||
WithLabelValues(service.Name).
|
||||
Set(float64(service.Replicas))
|
||||
}
|
||||
e.metricOptions.ServiceReplicasCounter.Collect(ch)
|
||||
e.metricOptions.ServiceReplicasGauge.Collect(ch)
|
||||
}
|
||||
|
||||
// StartServiceWatcher starts a ticker and collects service replica counts to expose to prometheus
|
||||
|
Reference in New Issue
Block a user