diff options
author | 2021-10-28 10:50:23 +0200 | |
---|---|---|
committer | 2021-10-28 08:50:23 +0000 | |
commit | 5934c7e89ea2f378f5bc360e64382cb423a78abe (patch) | |
tree | 33f6e2997cfc25d331a1d661aae0d09c2a4f14b4 /plugin | |
parent | de21fb24367f1586376c48e27de3318c48b59ea3 (diff) | |
download | coredns-5934c7e89ea2f378f5bc360e64382cb423a78abe.tar.gz coredns-5934c7e89ea2f378f5bc360e64382cb423a78abe.tar.zst coredns-5934c7e89ea2f378f5bc360e64382cb423a78abe.zip |
plugin/metrics: support HTTPS qType in requests count metric label (#4934)
Automatically submitted.
Diffstat (limited to 'plugin')
-rw-r--r-- | plugin/metrics/README.md | 2 | ||||
-rw-r--r-- | plugin/metrics/vars/monitor.go | 3 | ||||
-rw-r--r-- | plugin/metrics/vars/report.go | 4 |
3 files changed, 5 insertions, 4 deletions
diff --git a/plugin/metrics/README.md b/plugin/metrics/README.md index ab773f65b..602460f60 100644 --- a/plugin/metrics/README.md +++ b/plugin/metrics/README.md @@ -30,7 +30,7 @@ Extra labels used are: * `proto` which holds the transport of the response ("udp" or "tcp") * The address family (`family`) of the transport (1 = IP (IP version 4), 2 = IP6 (IP version 6)). * `type` which holds the query type. It holds most common types (A, AAAA, MX, SOA, CNAME, PTR, TXT, - NS, SRV, DS, DNSKEY, RRSIG, NSEC, NSEC3, IXFR, AXFR and ANY) and "other" which lumps together all + NS, SRV, DS, DNSKEY, RRSIG, NSEC, NSEC3, HTTPS, IXFR, AXFR and ANY) and "other" which lumps together all other types. If monitoring is enabled, queries that do not enter the plugin chain are exported under the fake diff --git a/plugin/metrics/vars/monitor.go b/plugin/metrics/vars/monitor.go index 17ca7cf63..191324e59 100644 --- a/plugin/metrics/vars/monitor.go +++ b/plugin/metrics/vars/monitor.go @@ -19,6 +19,7 @@ var monitorType = map[uint16]struct{}{ dns.TypeSOA: {}, dns.TypeSRV: {}, dns.TypeTXT: {}, + dns.TypeHTTPS: {}, // Meta Qtypes dns.TypeIXFR: {}, dns.TypeAXFR: {}, @@ -26,7 +27,7 @@ var monitorType = map[uint16]struct{}{ } // qTypeString returns the RR type based on monitorType. It returns the text representation -// of thosAe types. RR types not in that list will have "other" returned. +// of those types. RR types not in that list will have "other" returned. func qTypeString(qtype uint16) string { if _, known := monitorType[qtype]; known { return dns.Type(qtype).String() diff --git a/plugin/metrics/vars/report.go b/plugin/metrics/vars/report.go index d32e361b1..5aaff2f00 100644 --- a/plugin/metrics/vars/report.go +++ b/plugin/metrics/vars/report.go @@ -21,8 +21,8 @@ func Report(server string, req request.Request, zone, rcode string, size int, st RequestDo.WithLabelValues(server, zone).Inc() } - qtype := qTypeString(req.QType()) - RequestCount.WithLabelValues(server, zone, net, fam, qtype).Inc() + qType := qTypeString(req.QType()) + RequestCount.WithLabelValues(server, zone, net, fam, qType).Inc() RequestDuration.WithLabelValues(server, zone).Observe(time.Since(start).Seconds()) |