mirror of
https://github.com/openfaas/faas.git
synced 2025-06-10 17: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()
|
Inc()
|
||||||
} else if event == "started" {
|
} else if event == "started" {
|
||||||
serviceName := getServiceName(originalURL)
|
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.GatewayFunctionInvocation.Describe(ch)
|
||||||
e.metricOptions.GatewayFunctionsHistogram.Describe(ch)
|
e.metricOptions.GatewayFunctionsHistogram.Describe(ch)
|
||||||
e.metricOptions.ServiceReplicasGauge.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.Counter.Describe(ch)
|
||||||
e.metricOptions.ServiceMetrics.Histogram.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.GatewayFunctionInvocation.Collect(ch)
|
||||||
e.metricOptions.GatewayFunctionsHistogram.Collect(ch)
|
e.metricOptions.GatewayFunctionsHistogram.Collect(ch)
|
||||||
|
|
||||||
e.metricOptions.StartedCounter.Collect(ch)
|
e.metricOptions.GatewayFunctionInvocationStarted.Collect(ch)
|
||||||
|
|
||||||
e.metricOptions.ServiceReplicasGauge.Reset()
|
e.metricOptions.ServiceReplicasGauge.Reset()
|
||||||
for _, service := range e.services {
|
for _, service := range e.services {
|
||||||
|
@ -15,9 +15,9 @@ import (
|
|||||||
type MetricOptions struct {
|
type MetricOptions struct {
|
||||||
GatewayFunctionInvocation *prometheus.CounterVec
|
GatewayFunctionInvocation *prometheus.CounterVec
|
||||||
GatewayFunctionsHistogram *prometheus.HistogramVec
|
GatewayFunctionsHistogram *prometheus.HistogramVec
|
||||||
|
GatewayFunctionInvocationStarted *prometheus.CounterVec
|
||||||
ServiceReplicasGauge *prometheus.GaugeVec
|
ServiceReplicasGauge *prometheus.GaugeVec
|
||||||
ServiceMetrics *ServiceMetricOptions
|
ServiceMetrics *ServiceMetricOptions
|
||||||
StartedCounter *prometheus.CounterVec
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ServiceMetricOptions provides RED metrics
|
// ServiceMetricOptions provides RED metrics
|
||||||
@ -82,7 +82,7 @@ func BuildMetricsOptions() MetricOptions {
|
|||||||
[]string{"method", "path", "status"},
|
[]string{"method", "path", "status"},
|
||||||
)
|
)
|
||||||
|
|
||||||
startedCounter := prometheus.NewCounterVec(
|
gatewayFunctionInvocationStarted := prometheus.NewCounterVec(
|
||||||
prometheus.CounterOpts{
|
prometheus.CounterOpts{
|
||||||
Namespace: "gateway",
|
Namespace: "gateway",
|
||||||
Subsystem: "function",
|
Subsystem: "function",
|
||||||
@ -102,7 +102,7 @@ func BuildMetricsOptions() MetricOptions {
|
|||||||
GatewayFunctionInvocation: gatewayFunctionInvocation,
|
GatewayFunctionInvocation: gatewayFunctionInvocation,
|
||||||
ServiceReplicasGauge: serviceReplicas,
|
ServiceReplicasGauge: serviceReplicas,
|
||||||
ServiceMetrics: serviceMetricOptions,
|
ServiceMetrics: serviceMetricOptions,
|
||||||
StartedCounter: startedCounter,
|
GatewayFunctionInvocationStarted: gatewayFunctionInvocationStarted,
|
||||||
}
|
}
|
||||||
|
|
||||||
return metricsOptions
|
return metricsOptions
|
||||||
|
Loading…
x
Reference in New Issue
Block a user