diff options
-rw-r--r-- | plugin/acl/README.md | 6 | ||||
-rw-r--r-- | plugin/acl/acl.go | 6 | ||||
-rw-r--r-- | plugin/acl/metrics.go | 6 |
3 files changed, 10 insertions, 8 deletions
diff --git a/plugin/acl/README.md b/plugin/acl/README.md index 4b34500e4..6e5b827e1 100644 --- a/plugin/acl/README.md +++ b/plugin/acl/README.md @@ -89,8 +89,10 @@ example.org { If monitoring is enabled (via the _prometheus_ plugin) then the following metrics are exported: -- `coredns_acl_blocked_requests_total{server, zone}` - counter of DNS requests being blocked. +- `coredns_acl_blocked_requests_total{server, zone, view}` - counter of DNS requests being blocked. -- `coredns_acl_allowed_requests_total{server}` - counter of DNS requests being allowed. +- `coredns_acl_filtered_requests_total{server, zone, view}` - counter of DNS requests being filtered. + +- `coredns_acl_allowed_requests_total{server, view}` - counter of DNS requests being allowed. The `server` and `zone` labels are explained in the _metrics_ plugin documentation. diff --git a/plugin/acl/acl.go b/plugin/acl/acl.go index 017a8ac6b..7d7b9d600 100644 --- a/plugin/acl/acl.go +++ b/plugin/acl/acl.go @@ -75,7 +75,7 @@ RulesCheckLoop: ede := dns.EDNS0_EDE{InfoCode: dns.ExtendedErrorCodeBlocked} m.IsEdns0().Option = append(m.IsEdns0().Option, &ede) w.WriteMsg(m) - RequestBlockCount.WithLabelValues(metrics.WithServer(ctx), zone).Inc() + RequestBlockCount.WithLabelValues(metrics.WithServer(ctx), zone, metrics.WithView(ctx)).Inc() return dns.RcodeSuccess, nil } case actionAllow: @@ -90,13 +90,13 @@ RulesCheckLoop: ede := dns.EDNS0_EDE{InfoCode: dns.ExtendedErrorCodeFiltered} m.IsEdns0().Option = append(m.IsEdns0().Option, &ede) w.WriteMsg(m) - RequestFilterCount.WithLabelValues(metrics.WithServer(ctx), zone).Inc() + RequestFilterCount.WithLabelValues(metrics.WithServer(ctx), zone, metrics.WithView(ctx)).Inc() return dns.RcodeSuccess, nil } } } - RequestAllowCount.WithLabelValues(metrics.WithServer(ctx)).Inc() + RequestAllowCount.WithLabelValues(metrics.WithServer(ctx), metrics.WithView(ctx)).Inc() return plugin.NextOrFailure(state.Name(), a.Next, ctx, w, r) } diff --git a/plugin/acl/metrics.go b/plugin/acl/metrics.go index 76f30b5a6..04d728bcd 100644 --- a/plugin/acl/metrics.go +++ b/plugin/acl/metrics.go @@ -14,19 +14,19 @@ var ( Subsystem: pluginName, Name: "blocked_requests_total", Help: "Counter of DNS requests being blocked.", - }, []string{"server", "zone"}) + }, []string{"server", "zone", "view"}) // RequestFilterCount is the number of DNS requests being filtered. RequestFilterCount = promauto.NewCounterVec(prometheus.CounterOpts{ Namespace: plugin.Namespace, Subsystem: pluginName, Name: "filtered_requests_total", Help: "Counter of DNS requests being filtered.", - }, []string{"server", "zone"}) + }, []string{"server", "zone", "view"}) // RequestAllowCount is the number of DNS requests being Allowed. RequestAllowCount = promauto.NewCounterVec(prometheus.CounterOpts{ Namespace: plugin.Namespace, Subsystem: pluginName, Name: "allowed_requests_total", Help: "Counter of DNS requests being allowed.", - }, []string{"server"}) + }, []string{"server", "view"}) ) |