Skip to content

Commit 2faff03

Browse files
authored
Metrics for TLS resumes, DoH, and aggressive NSEC (#53)
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
1 parent 1d05a27 commit 2faff03

File tree

1 file changed

+20
-2
lines changed

1 file changed

+20
-2
lines changed

unbound_exporter.go

+20-2
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ var (
154154
"^num\\.query\\.edns\\.present$"),
155155
newUnboundMetric(
156156
"query_tcp_total",
157-
"Total number of queries that were made using TCP towards the Unbound server.",
157+
"Total number of queries that were made using TCP towards the Unbound server, including DoT and DoH queries.",
158158
prometheus.CounterValue,
159159
nil,
160160
"^num\\.query\\.tcp$"),
@@ -166,10 +166,22 @@ var (
166166
"^num\\.query\\.tcpout$"),
167167
newUnboundMetric(
168168
"query_tls_total",
169-
"Total number of queries that were made using TCP TLS towards the Unbound server.",
169+
"Total number of queries that were made using TCP TLS towards the Unbound server, including DoT and DoH queries.",
170170
prometheus.CounterValue,
171171
nil,
172172
"^num\\.query\\.tls$"),
173+
newUnboundMetric(
174+
"query_tls_resume_total",
175+
"Total number of queries that were made using TCP TLS Resume towards the Unbound server.",
176+
prometheus.CounterValue,
177+
nil,
178+
"^num\\.query\\.tls\\.resume$"),
179+
newUnboundMetric(
180+
"query_https_total",
181+
"Total number of queries that were made using HTTPS towards the Unbound server.",
182+
prometheus.CounterValue,
183+
nil,
184+
"^num\\.query\\.https$"),
173185
newUnboundMetric(
174186
"query_types_total",
175187
"Total number of queries with a given query type.",
@@ -182,6 +194,12 @@ var (
182194
prometheus.CounterValue,
183195
nil,
184196
"^num\\.query\\.udpout$"),
197+
newUnboundMetric(
198+
"query_aggressive_nsec",
199+
"Total number of queries that the Unbound server generated response using Aggressive NSEC.",
200+
prometheus.CounterValue,
201+
[]string{"rcode"},
202+
"^num\\.query\\.aggressive\\.(\\w+)$"),
185203
newUnboundMetric(
186204
"request_list_current_all",
187205
"Current size of the request list, including internally generated queries.",

0 commit comments

Comments
 (0)