Skip to content

Commit

Permalink
Metrics for TLS resumes, DoH, and aggressive NSEC (#53)
Browse files Browse the repository at this point in the history
Map unbound's `num.query.agressive.*` stats to `query_aggressive_nsec`
metrics. This counter tracks the number of queries that unbound
synthesised answers based on the cached NSEC records.

See https://unbound.docs.nlnetlabs.nl/en/latest/topics/privacy/aggressive-nsec.html

Also add `query_tls_resume_total` and `query_https_total` metrics,
which track the number of queries received using TLS resume
and DNS-over-HTTPS transport, resp.

Fixes #48
  • Loading branch information
hanazuki authored Aug 23, 2023
1 parent 1d05a27 commit 2faff03
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions unbound_exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ var (
"^num\\.query\\.edns\\.present$"),
newUnboundMetric(
"query_tcp_total",
"Total number of queries that were made using TCP towards the Unbound server.",
"Total number of queries that were made using TCP towards the Unbound server, including DoT and DoH queries.",
prometheus.CounterValue,
nil,
"^num\\.query\\.tcp$"),
Expand All @@ -166,10 +166,22 @@ var (
"^num\\.query\\.tcpout$"),
newUnboundMetric(
"query_tls_total",
"Total number of queries that were made using TCP TLS towards the Unbound server.",
"Total number of queries that were made using TCP TLS towards the Unbound server, including DoT and DoH queries.",
prometheus.CounterValue,
nil,
"^num\\.query\\.tls$"),
newUnboundMetric(
"query_tls_resume_total",
"Total number of queries that were made using TCP TLS Resume towards the Unbound server.",
prometheus.CounterValue,
nil,
"^num\\.query\\.tls\\.resume$"),
newUnboundMetric(
"query_https_total",
"Total number of queries that were made using HTTPS towards the Unbound server.",
prometheus.CounterValue,
nil,
"^num\\.query\\.https$"),
newUnboundMetric(
"query_types_total",
"Total number of queries with a given query type.",
Expand All @@ -182,6 +194,12 @@ var (
prometheus.CounterValue,
nil,
"^num\\.query\\.udpout$"),
newUnboundMetric(
"query_aggressive_nsec",
"Total number of queries that the Unbound server generated response using Aggressive NSEC.",
prometheus.CounterValue,
[]string{"rcode"},
"^num\\.query\\.aggressive\\.(\\w+)$"),
newUnboundMetric(
"request_list_current_all",
"Current size of the request list, including internally generated queries.",
Expand Down

0 comments on commit 2faff03

Please sign in to comment.