mirror of
https://github.com/coredns/coredns.git
synced 2025-11-01 18:53:43 -04:00
plugin/metrics: support HTTPS qType in requests count metric label (#4934)
Automatically submitted.
This commit is contained in:
@@ -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()
|
||||
|
||||
@@ -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())
|
||||
|
||||
|
||||
Reference in New Issue
Block a user