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/connect.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/connect.go')
-rw-r--r-- | plugin/pkg/proxy/connect.go | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/plugin/pkg/proxy/connect.go b/plugin/pkg/proxy/connect.go index b60a1a237..d799df498 100644 --- a/plugin/pkg/proxy/connect.go +++ b/plugin/pkg/proxy/connect.go @@ -55,10 +55,10 @@ func (t *Transport) Dial(proto string) (*persistConn, bool, error) { pc := <-t.ret if pc != nil { - ConnCacheHitsCount.WithLabelValues(t.addr, proto).Add(1) + connCacheHitsCount.WithLabelValues(t.proxyName, t.addr, proto).Add(1) return pc, true, nil } - ConnCacheMissesCount.WithLabelValues(t.addr, proto).Add(1) + connCacheMissesCount.WithLabelValues(t.proxyName, t.addr, proto).Add(1) reqTime := time.Now() timeout := t.dialTimeout() @@ -152,9 +152,7 @@ func (p *Proxy) Connect(ctx context.Context, state request.Request, opts Options rc = strconv.Itoa(ret.Rcode) } - RequestCount.WithLabelValues(p.addr).Add(1) - RcodeCount.WithLabelValues(rc, p.addr).Add(1) - RequestDuration.WithLabelValues(p.addr, rc).Observe(time.Since(start).Seconds()) + requestDuration.WithLabelValues(p.proxyName, p.addr, rc).Observe(time.Since(start).Seconds()) return ret, nil } |