diff options
author | 2020-02-19 09:57:42 +0100 | |
---|---|---|
committer | 2020-02-19 08:57:42 +0000 | |
commit | ed1841c36f8633d7bd6ea3bc8a22eb16ce67377e (patch) | |
tree | b4aa54f83c6b72d273a17a8fcbec0077514f17be /plugin/metrics/vars/report.go | |
parent | c8a6b16d86a5fadc8b4dba9ce3c6e65e12fd5b3a (diff) | |
download | coredns-ed1841c36f8633d7bd6ea3bc8a22eb16ce67377e.tar.gz coredns-ed1841c36f8633d7bd6ea3bc8a22eb16ce67377e.tar.zst coredns-ed1841c36f8633d7bd6ea3bc8a22eb16ce67377e.zip |
metrics: add type to latency as well (#3685)
Automatically submitted.
Diffstat (limited to 'plugin/metrics/vars/report.go')
-rw-r--r-- | plugin/metrics/vars/report.go | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/plugin/metrics/vars/report.go b/plugin/metrics/vars/report.go index 77ed281f2..b0a9950ce 100644 --- a/plugin/metrics/vars/report.go +++ b/plugin/metrics/vars/report.go @@ -21,7 +21,6 @@ func Report(server string, req request.Request, zone, rcode string, size int, st typ := req.QType() RequestCount.WithLabelValues(server, zone, net, fam).Inc() - RequestDuration.WithLabelValues(server, zone).Observe(time.Since(start).Seconds()) if req.Do() { RequestDo.WithLabelValues(server, zone).Inc() @@ -29,8 +28,10 @@ func Report(server string, req request.Request, zone, rcode string, size int, st if _, known := monitorType[typ]; known { RequestType.WithLabelValues(server, zone, dns.Type(typ).String()).Inc() + RequestDuration.WithLabelValues(server, zone, dns.Type(typ).String()).Observe(time.Since(start).Seconds()) } else { RequestType.WithLabelValues(server, zone, other).Inc() + RequestDuration.WithLabelValues(server, zone, other).Observe(time.Since(start).Seconds()) } ResponseSize.WithLabelValues(server, zone, net).Observe(float64(size)) |