mirror of
https://github.com/openfaas/faas.git
synced 2025-06-09 16:56:47 +00:00
Fix label order for http_requests_total
- the order of http_requests_total was shown to be incorrect in testing. This fixes the order as per http_request_duration_seconds. Signed-off-by: Alex Ellis (VMware) <alexellis2@gmail.com>
This commit is contained in:
parent
a26d350376
commit
ec185bad67
@ -25,7 +25,8 @@ type PrometheusServiceNotifier struct {
|
|||||||
func (psn PrometheusServiceNotifier) Notify(method string, URL string, originalURL string, statusCode int, duration time.Duration) {
|
func (psn PrometheusServiceNotifier) Notify(method string, URL string, originalURL string, statusCode int, duration time.Duration) {
|
||||||
code := fmt.Sprintf("%d", statusCode)
|
code := fmt.Sprintf("%d", statusCode)
|
||||||
path := urlToLabel(URL)
|
path := urlToLabel(URL)
|
||||||
psn.ServiceMetrics.Counter.WithLabelValues(code, method, path).Inc()
|
|
||||||
|
psn.ServiceMetrics.Counter.WithLabelValues(method, path, code).Inc()
|
||||||
psn.ServiceMetrics.Histogram.WithLabelValues(method, path, code).Observe(duration.Seconds())
|
psn.ServiceMetrics.Histogram.WithLabelValues(method, path, code).Observe(duration.Seconds())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user