diff options
author | 2017-02-07 21:28:47 +0000 | |
---|---|---|
committer | 2017-02-07 21:28:47 +0000 | |
commit | fa0abe747327b7dda0b2566f45dcea649f26fb0b (patch) | |
tree | d18a3f6309367faab920ee3b7567cc051a7d09b7 /middleware/proxy/proxy.go | |
parent | dbe1b2510d609bf37b0874f0aafa91e982cdc5c2 (diff) | |
download | coredns-fa0abe747327b7dda0b2566f45dcea649f26fb0b.tar.gz coredns-fa0abe747327b7dda0b2566f45dcea649f26fb0b.tar.zst coredns-fa0abe747327b7dda0b2566f45dcea649f26fb0b.zip |
middleware/proxy: sane(r) metrics
Add proxy_proto and re-instate proto to be the protocol of the incoming
query ("tcp" or "udp").
Diffstat (limited to 'middleware/proxy/proxy.go')
-rw-r--r-- | middleware/proxy/proxy.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/middleware/proxy/proxy.go b/middleware/proxy/proxy.go index b8b50adc6..1a595d99e 100644 --- a/middleware/proxy/proxy.go +++ b/middleware/proxy/proxy.go @@ -93,7 +93,7 @@ func (p Proxy) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.Msg) ( host := upstream.Select() if host == nil { - RequestDuration.WithLabelValues(upstream.Exchanger().Protocol(), upstream.From()).Observe(float64(time.Since(start) / time.Millisecond)) + RequestDuration.WithLabelValues(state.Proto(), upstream.Exchanger().Protocol(), upstream.From()).Observe(float64(time.Since(start) / time.Millisecond)) return dns.RcodeServerFailure, errUnreachable } @@ -116,7 +116,7 @@ func (p Proxy) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.Msg) ( if backendErr == nil { w.WriteMsg(reply) - RequestDuration.WithLabelValues(upstream.Exchanger().Protocol(), upstream.From()).Observe(float64(time.Since(start) / time.Millisecond)) + RequestDuration.WithLabelValues(state.Proto(), upstream.Exchanger().Protocol(), upstream.From()).Observe(float64(time.Since(start) / time.Millisecond)) return 0, nil } @@ -131,7 +131,7 @@ func (p Proxy) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.Msg) ( }(host, timeout) } - RequestDuration.WithLabelValues(upstream.Exchanger().Protocol(), upstream.From()).Observe(float64(time.Since(start) / time.Millisecond)) + RequestDuration.WithLabelValues(state.Proto(), upstream.Exchanger().Protocol(), upstream.From()).Observe(float64(time.Since(start) / time.Millisecond)) return dns.RcodeServerFailure, errUnreachable } |