mirror of
https://github.com/coredns/coredns.git
synced 2025-11-01 10:43:17 -04:00
Update more metrics names (#3799)
The subsystem of a metric must be it's plugin name. "dns" is reserved for the core. Use a const convention to avoid copy-paste mistakes in naming. Fix dns64 and acl plugin. Signed-off-by: Ben Kochie <superq@gmail.com>
This commit is contained in:
@@ -73,8 +73,8 @@ example.org {
|
||||
|
||||
If monitoring is enabled (via the _prometheus_ plugin) then the following metrics are exported:
|
||||
|
||||
- `coredns_dns_blocked_requests_total{server, zone}` - counter of DNS requests being blocked.
|
||||
- `coredns_acl_blocked_requests_total{server, zone}` - counter of DNS requests being blocked.
|
||||
|
||||
- `coredns_dns_allowed_requests_total{server}` - counter of DNS requests being allowed.
|
||||
- `coredns_acl_allowed_requests_total{server}` - counter of DNS requests being allowed.
|
||||
|
||||
The `server` and `zone` labels are explained in the _metrics_ plugin documentation.
|
||||
|
||||
@@ -10,15 +10,15 @@ var (
|
||||
// RequestBlockCount is the number of DNS requests being blocked.
|
||||
RequestBlockCount = prometheus.NewCounterVec(prometheus.CounterOpts{
|
||||
Namespace: plugin.Namespace,
|
||||
Subsystem: "dns",
|
||||
Name: "acl_blocked_requests_total",
|
||||
Subsystem: pluginName,
|
||||
Name: "blocked_requests_total",
|
||||
Help: "Counter of DNS requests being blocked.",
|
||||
}, []string{"server", "zone"})
|
||||
// RequestAllowCount is the number of DNS requests being Allowed.
|
||||
RequestAllowCount = prometheus.NewCounterVec(prometheus.CounterOpts{
|
||||
Namespace: plugin.Namespace,
|
||||
Subsystem: "dns",
|
||||
Name: "acl_allowed_requests_total",
|
||||
Subsystem: pluginName,
|
||||
Name: "allowed_requests_total",
|
||||
Help: "Counter of DNS requests being allowed.",
|
||||
}, []string{"server"})
|
||||
)
|
||||
|
||||
@@ -13,7 +13,9 @@ import (
|
||||
"github.com/miekg/dns"
|
||||
)
|
||||
|
||||
func init() { plugin.Register("acl", setup) }
|
||||
const pluginName = "acl"
|
||||
|
||||
func init() { plugin.Register(pluginName, setup) }
|
||||
|
||||
func newDefaultFilter() *iptree.Tree {
|
||||
defaultFilter := iptree.NewTree()
|
||||
@@ -27,7 +29,7 @@ func newDefaultFilter() *iptree.Tree {
|
||||
func setup(c *caddy.Controller) error {
|
||||
a, err := parse(c)
|
||||
if err != nil {
|
||||
return plugin.Error("acl", err)
|
||||
return plugin.Error(pluginName, err)
|
||||
}
|
||||
|
||||
dnsserver.GetConfig(c).AddPlugin(func(next plugin.Handler) plugin.Handler {
|
||||
|
||||
Reference in New Issue
Block a user