middleware/metrics: proto in size response as well

This commit is contained in:
Miek Gieben 2016-06-24 08:47:28 +00:00
parent 4c00e444f3
commit 11094409ac
3 changed files with 3 additions and 2 deletions

View file

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

View file

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

View file

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