diff options
author | 2023-07-04 15:35:55 +0100 | |
---|---|---|
committer | 2023-07-04 16:35:55 +0200 | |
commit | ea293da1d6bb0c4f598c8790c6941d56c79c0aa3 (patch) | |
tree | 9e808cf986b72673e2b9b176624cada501cd594e /plugin/pkg/proxy/metrics.go | |
parent | 6e1263d3d9ae1deef399df23d4ae47d2c3154e03 (diff) | |
download | coredns-ea293da1d6bb0c4f598c8790c6941d56c79c0aa3.tar.gz coredns-ea293da1d6bb0c4f598c8790c6941d56c79c0aa3.tar.zst coredns-ea293da1d6bb0c4f598c8790c6941d56c79c0aa3.zip |
Fix forward metrics for backwards compatibility (#6178)
Diffstat (limited to 'plugin/pkg/proxy/metrics.go')
-rw-r--r-- | plugin/pkg/proxy/metrics.go | 31 |
1 files changed, 11 insertions, 20 deletions
diff --git a/plugin/pkg/proxy/metrics.go b/plugin/pkg/proxy/metrics.go index 148bc6edd..e4cae97c3 100644 --- a/plugin/pkg/proxy/metrics.go +++ b/plugin/pkg/proxy/metrics.go @@ -9,41 +9,32 @@ import ( // Variables declared for monitoring. var ( - RequestCount = promauto.NewCounterVec(prometheus.CounterOpts{ - Namespace: plugin.Namespace, - Subsystem: "proxy", - Name: "requests_total", - Help: "Counter of requests made per upstream.", - }, []string{"to"}) - RcodeCount = promauto.NewCounterVec(prometheus.CounterOpts{ - Namespace: plugin.Namespace, - Subsystem: "proxy", - Name: "responses_total", - Help: "Counter of responses received per upstream.", - }, []string{"rcode", "to"}) - RequestDuration = promauto.NewHistogramVec(prometheus.HistogramOpts{ + requestDuration = promauto.NewHistogramVec(prometheus.HistogramOpts{ Namespace: plugin.Namespace, Subsystem: "proxy", Name: "request_duration_seconds", Buckets: plugin.TimeBuckets, Help: "Histogram of the time each request took.", - }, []string{"to", "rcode"}) - HealthcheckFailureCount = promauto.NewCounterVec(prometheus.CounterOpts{ + }, []string{"proxy_name", "to", "rcode"}) + + healthcheckFailureCount = promauto.NewCounterVec(prometheus.CounterOpts{ Namespace: plugin.Namespace, Subsystem: "proxy", Name: "healthcheck_failures_total", Help: "Counter of the number of failed healthchecks.", - }, []string{"to"}) - ConnCacheHitsCount = promauto.NewCounterVec(prometheus.CounterOpts{ + }, []string{"proxy_name", "to"}) + + connCacheHitsCount = promauto.NewCounterVec(prometheus.CounterOpts{ Namespace: plugin.Namespace, Subsystem: "proxy", Name: "conn_cache_hits_total", Help: "Counter of connection cache hits per upstream and protocol.", - }, []string{"to", "proto"}) - ConnCacheMissesCount = promauto.NewCounterVec(prometheus.CounterOpts{ + }, []string{"proxy_name", "to", "proto"}) + + connCacheMissesCount = promauto.NewCounterVec(prometheus.CounterOpts{ Namespace: plugin.Namespace, Subsystem: "proxy", Name: "conn_cache_misses_total", Help: "Counter of connection cache misses per upstream and protocol.", - }, []string{"to", "proto"}) + }, []string{"proxy_name", "to", "proto"}) ) |