metrics: add type to latency as well (#3685)

Automatically submitted.
This commit is contained in:
Miek Gieben
2020-02-19 09:57:42 +01:00
committed by GitHub
parent c8a6b16d86
commit ed1841c36f
3 changed files with 4 additions and 3 deletions

View File

@@ -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))