@@ -29,8 +29,8 @@ import (
29
29
"github.com/prometheus-community/bind_exporter/bind"
30
30
"github.com/prometheus-community/bind_exporter/bind/auto"
31
31
"github.com/prometheus-community/bind_exporter/bind/json"
32
- "github.com/prometheus-community/bind_exporter/bind/v2"
33
- "github.com/prometheus-community/bind_exporter/bind/v3"
32
+ v2 "github.com/prometheus-community/bind_exporter/bind/v2"
33
+ v3 "github.com/prometheus-community/bind_exporter/bind/v3"
34
34
"github.com/prometheus/client_golang/prometheus"
35
35
"github.com/prometheus/client_golang/prometheus/collectors"
36
36
"github.com/prometheus/client_golang/prometheus/promhttp"
@@ -220,6 +220,16 @@ var (
220
220
"Zone serial number." ,
221
221
[]string {"view" , "zone_name" }, nil ,
222
222
)
223
+ zoneRcode = prometheus .NewDesc (
224
+ prometheus .BuildFQName (namespace , "" , "zone_incoming_rcodes_total" ),
225
+ "Number of incoming DNS requests per zone." ,
226
+ []string {"zone_name" , "rcode" }, nil ,
227
+ )
228
+ zoneQtype = prometheus .NewDesc (
229
+ prometheus .BuildFQName (namespace , "" , "zone_incoming_queries_total" ),
230
+ "Number of incoming DNS requests per zone." ,
231
+ []string {"zone_name" , "type" }, nil ,
232
+ )
223
233
)
224
234
225
235
type collectorConstructor func (* bind.Statistics ) prometheus.Collector
@@ -358,6 +368,24 @@ func (c *viewCollector) Collect(ch chan<- prometheus.Metric) {
358
368
}
359
369
}
360
370
}
371
+ for _ , v := range c .stats .ZoneViews {
372
+ for _ , z := range v .ZoneData {
373
+ for _ , x := range z .ZoneRcode {
374
+ ch <- prometheus .MustNewConstMetric (
375
+ zoneRcode , prometheus .CounterValue , float64 (x .Counter ), z .Name , x .Name ,
376
+ )
377
+ }
378
+ }
379
+ }
380
+ for _ , v := range c .stats .ZoneViews {
381
+ for _ , z := range v .ZoneData {
382
+ for _ , x := range z .ZoneQtype {
383
+ ch <- prometheus .MustNewConstMetric (
384
+ zoneQtype , prometheus .CounterValue , float64 (x .Counter ), z .Name , x .Name ,
385
+ )
386
+ }
387
+ }
388
+ }
361
389
}
362
390
363
391
type taskCollector struct {
0 commit comments