diff --git a/middleware/metrics/README.md b/middleware/metrics/README.md index 973d257e1..99b5a9f27 100644 --- a/middleware/metrics/README.md +++ b/middleware/metrics/README.md @@ -17,6 +17,7 @@ Each counter has a label `zone` which is the zonename used for the request/respo holds the transport of the response ("udp" or "tcp") and the address family of the transport (1 = IP (IP version 4), 2 = IP6 (IP version 6)). The `response_rcode_count_total` has an extra label `rcode` which holds the rcode of the response. +The `*_size_bytes` counters also hold the protocol in the `proto` label ("udp" or "tcp"). If monitoring is enabled queries that do not enter the middleware chain are exported under the fake domain "dropped" (without a closing dot). diff --git a/middleware/metrics/handler.go b/middleware/metrics/handler.go index 6d0eb1f84..019a02c3e 100644 --- a/middleware/metrics/handler.go +++ b/middleware/metrics/handler.go @@ -49,6 +49,6 @@ func Report(state middleware.State, zone, rcode string, size int, start time.Tim requestDo.WithLabelValues(zone).Inc() } - responseSize.WithLabelValues(zone).Observe(float64(size)) + responseSize.WithLabelValues(zone, net).Observe(float64(size)) responseRcode.WithLabelValues(zone, rcode).Inc() } diff --git a/middleware/metrics/metrics.go b/middleware/metrics/metrics.go index 5c2c37ff8..093f2a7dd 100644 --- a/middleware/metrics/metrics.go +++ b/middleware/metrics/metrics.go @@ -103,7 +103,7 @@ func define() { Name: "response_size_bytes", Help: "Size of the returns response in bytes.", Buckets: []float64{0, 100, 200, 300, 400, 511, 1023, 2047, 4095, 8291, 16e3, 32e3, 48e3, 64e3}, - }, []string{"zone"}) + }, []string{"zone", "proto"}) responseRcode = prometheus.NewCounterVec(prometheus.CounterOpts{ Namespace: middleware.Namespace,