mirror of
https://github.com/openfaas/faas.git
synced 2025-06-19 04:26:35 +00:00
Add service RED metrics definitions
Partially fixes #532 by introducing two metrics that are supported by Kubernetes HPAv2 and RED metrics-style dashboards. Signed-off-by: Alex Ellis (VMware) <alexellis2@gmail.com>
This commit is contained in:
committed by
Alex Ellis
parent
5157e68479
commit
1cc767e898
@ -40,6 +40,9 @@ func (e *Exporter) Describe(ch chan<- *prometheus.Desc) {
|
||||
e.metricOptions.GatewayFunctionInvocation.Describe(ch)
|
||||
e.metricOptions.GatewayFunctionsHistogram.Describe(ch)
|
||||
e.metricOptions.ServiceReplicasGauge.Describe(ch)
|
||||
|
||||
e.metricOptions.ServiceMetrics.Counter.Describe(ch)
|
||||
e.metricOptions.ServiceMetrics.Histogram.Describe(ch)
|
||||
}
|
||||
|
||||
// Collect collects data to be consumed by prometheus
|
||||
@ -54,6 +57,9 @@ func (e *Exporter) Collect(ch chan<- prometheus.Metric) {
|
||||
Set(float64(service.Replicas))
|
||||
}
|
||||
e.metricOptions.ServiceReplicasGauge.Collect(ch)
|
||||
|
||||
e.metricOptions.ServiceMetrics.Counter.Collect(ch)
|
||||
e.metricOptions.ServiceMetrics.Histogram.Collect(ch)
|
||||
}
|
||||
|
||||
// StartServiceWatcher starts a ticker and collects service replica counts to expose to prometheus
|
||||
|
Reference in New Issue
Block a user