mirror of
https://github.com/coredns/coredns.git
synced 2025-11-03 10:43:20 -05:00
metrics: remove RR type (#4534)
To combat label cardinality explosions remove the type from metrics. This was most severe in the histogram for request duration, remove it there. It's also highlighted difference between grpc and forward code, where forward did use type and grpc didn't; getting rid of all that "fixes" that discrepancy Move monitor.go back into the vars directory and make it private again. Also name it slightly better Fixes: #4507 Signed-off-by: Miek Gieben <miek@miek.nl>
This commit is contained in:
@@ -1,37 +0,0 @@
|
||||
package dnsutil
|
||||
|
||||
import (
|
||||
"github.com/miekg/dns"
|
||||
)
|
||||
|
||||
var monitorType = map[uint16]struct{}{
|
||||
dns.TypeAAAA: {},
|
||||
dns.TypeA: {},
|
||||
dns.TypeCNAME: {},
|
||||
dns.TypeDNSKEY: {},
|
||||
dns.TypeDS: {},
|
||||
dns.TypeMX: {},
|
||||
dns.TypeNSEC3: {},
|
||||
dns.TypeNSEC: {},
|
||||
dns.TypeNS: {},
|
||||
dns.TypePTR: {},
|
||||
dns.TypeRRSIG: {},
|
||||
dns.TypeSOA: {},
|
||||
dns.TypeSRV: {},
|
||||
dns.TypeTXT: {},
|
||||
// Meta Qtypes
|
||||
dns.TypeIXFR: {},
|
||||
dns.TypeAXFR: {},
|
||||
dns.TypeANY: {},
|
||||
}
|
||||
|
||||
const other = "other"
|
||||
|
||||
// QTypeMonitorLabel returns dns type label based on a list of monitored types.
|
||||
// Will return "other" for unmonitored ones.
|
||||
func QTypeMonitorLabel(qtype uint16) string {
|
||||
if _, known := monitorType[qtype]; known {
|
||||
return dns.Type(qtype).String()
|
||||
}
|
||||
return other
|
||||
}
|
||||
Reference in New Issue
Block a user