mirror of
https://github.com/openfaas/faas.git
synced 2025-06-08 16:26:47 +00:00
Update Started variable to GatewayFunctionInvocationStarted
Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
This commit is contained in:
parent
96812d2cd8
commit
c4f924cfb5
@ -63,7 +63,7 @@ func (p PrometheusFunctionNotifier) Notify(method string, URL string, originalUR
|
||||
Inc()
|
||||
} else if event == "started" {
|
||||
serviceName := getServiceName(originalURL)
|
||||
p.Metrics.StartedCounter.WithLabelValues(serviceName).Inc()
|
||||
p.Metrics.GatewayFunctionInvocationStarted.WithLabelValues(serviceName).Inc()
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -41,7 +41,7 @@ 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.StartedCounter.Describe(ch)
|
||||
e.metricOptions.GatewayFunctionInvocationStarted.Describe(ch)
|
||||
|
||||
e.metricOptions.ServiceMetrics.Counter.Describe(ch)
|
||||
e.metricOptions.ServiceMetrics.Histogram.Describe(ch)
|
||||
@ -52,7 +52,7 @@ func (e *Exporter) Collect(ch chan<- prometheus.Metric) {
|
||||
e.metricOptions.GatewayFunctionInvocation.Collect(ch)
|
||||
e.metricOptions.GatewayFunctionsHistogram.Collect(ch)
|
||||
|
||||
e.metricOptions.StartedCounter.Collect(ch)
|
||||
e.metricOptions.GatewayFunctionInvocationStarted.Collect(ch)
|
||||
|
||||
e.metricOptions.ServiceReplicasGauge.Reset()
|
||||
for _, service := range e.services {
|
||||
|
@ -13,11 +13,11 @@ import (
|
||||
|
||||
// MetricOptions to be used by web handlers
|
||||
type MetricOptions struct {
|
||||
GatewayFunctionInvocation *prometheus.CounterVec
|
||||
GatewayFunctionsHistogram *prometheus.HistogramVec
|
||||
ServiceReplicasGauge *prometheus.GaugeVec
|
||||
ServiceMetrics *ServiceMetricOptions
|
||||
StartedCounter *prometheus.CounterVec
|
||||
GatewayFunctionInvocation *prometheus.CounterVec
|
||||
GatewayFunctionsHistogram *prometheus.HistogramVec
|
||||
GatewayFunctionInvocationStarted *prometheus.CounterVec
|
||||
ServiceReplicasGauge *prometheus.GaugeVec
|
||||
ServiceMetrics *ServiceMetricOptions
|
||||
}
|
||||
|
||||
// ServiceMetricOptions provides RED metrics
|
||||
@ -82,7 +82,7 @@ func BuildMetricsOptions() MetricOptions {
|
||||
[]string{"method", "path", "status"},
|
||||
)
|
||||
|
||||
startedCounter := prometheus.NewCounterVec(
|
||||
gatewayFunctionInvocationStarted := prometheus.NewCounterVec(
|
||||
prometheus.CounterOpts{
|
||||
Namespace: "gateway",
|
||||
Subsystem: "function",
|
||||
@ -98,11 +98,11 @@ func BuildMetricsOptions() MetricOptions {
|
||||
}
|
||||
|
||||
metricsOptions := MetricOptions{
|
||||
GatewayFunctionsHistogram: gatewayFunctionsHistogram,
|
||||
GatewayFunctionInvocation: gatewayFunctionInvocation,
|
||||
ServiceReplicasGauge: serviceReplicas,
|
||||
ServiceMetrics: serviceMetricOptions,
|
||||
StartedCounter: startedCounter,
|
||||
GatewayFunctionsHistogram: gatewayFunctionsHistogram,
|
||||
GatewayFunctionInvocation: gatewayFunctionInvocation,
|
||||
ServiceReplicasGauge: serviceReplicas,
|
||||
ServiceMetrics: serviceMetricOptions,
|
||||
GatewayFunctionInvocationStarted: gatewayFunctionInvocationStarted,
|
||||
}
|
||||
|
||||
return metricsOptions
|
||||
|
Loading…
x
Reference in New Issue
Block a user