4 The PowerDNS Recursor collects many statistics about itself.
8 Every half hour or so (configurable with :ref:`setting-statistics-interval`, the recursor outputs a line with statistics.
9 To force the output of statistics, send the process a SIGUSR1. A line of statistics looks like this::
11 Feb 10 14:16:03 stats: 125784 questions, 13971 cache entries, 309 negative entries, 84% cache hits, outpacket/query ratio 37%, 12% throttled
13 This means that there are 13791 different names cached, which each may have multiple records attached to them.
14 There are 309 items in the negative cache, items of which it is known that don't exist and won't do so for the near future.
15 84% of incoming questions could be answered without any additional queries going out to the net.
17 The outpacket/query ratio means that on average, 0.37 packets were needed to answer a question.
18 Initially this ratio may be well over 100% as additional queries may be needed to actually recurse the DNS and figure out the addresses of nameservers.
20 Finally, 12% of queries were not performed because identical queries had gone out previously and failed, saving load on servers worldwide.
24 Sending metrics to Graphite/Metronome over Carbon
25 -------------------------------------------------
26 For carbon/graphite/metronome, we use the following namespace.
27 Everything starts with 'pdns.', which is then followed by the local hostname.
28 Thirdly, we add 'recursor' to signify the daemon generating the metrics.
29 This is then rounded off with the actual name of the metric. As an example: 'pdns.ns1.recursor.questions'.
31 Care has been taken to make the sending of statistics as unobtrusive as possible, the daemons will not be hindered by an unreachable carbon server, timeouts or connection refused situations.
33 To benefit from our carbon/graphite support, either install Graphite, or use our own lightweight statistics daemon, Metronome, currently available on `GitHub <https://github.com/ahupowerdns/metronome/>`_.
35 To enable sending metrics, set :ref:`setting-carbon-server`, possibly :ref:`setting-carbon-interval` and possibly :ref:`setting-carbon-ourname` in the configuration.
39 If your hostname includes dots, they will be replaced by underscores so as not to confuse the namespace.
41 If you include dots in :ref:`setting-carbon-ourname`, they will **not** be replaced by underscores.
42 As PowerDNS assumes you know what you are doing if you override your hostname.
44 Sending metrics over SNMP
45 -------------------------
46 .. versionadded:: 4.1.0
48 The recursor can export statistics over SNMP and send traps from :doc:`Lua <lua-scripting/index>`, provided support is compiled into the Recursor and :ref:`setting-snmp-agent` set.
53 .. literalinclude:: ../RECURSOR-MIB.txt
55 Getting Metrics from the Recursor
56 ---------------------------------
58 Should Carbon not be the preferred way of receiving metric, several other techniques can be employed to retrieve metrics.
62 The :doc:`API <http-api/index>` exposes a statistics endpoint at :http:get:`/api/v1/servers/:server_id/statistics`.
63 This endpoint exports all statistics in a single JSON document.
67 Metrics can also be gathered on the system itself by invoking :doc:`rec_control <manpages/rec_control.1>`::
71 Single statistics can also be retrieved with the ``get`` command, e.g.::
73 rec_control get all-outqueries
75 External programs can use this technique to scrape metrics.
82 These statistics are gathered.
84 It should be noted that answers0-1 + answers1-10 + answers10-100 + answers100-1000 + answers-slow + packetcache-hits + over-capacity-drops + policy-drops = questions.
86 Also note that unauthorized-tcp and unauthorized-udp packets do not end up in the 'questions' count.
90 counts the number of outgoing UDP queries since starting
94 counts the number of queries answered after 1 second
98 counts the number of queries answered within 1 millisecond
102 counts the number of queries answered within 10 milliseconds
106 counts the number of queries answered within 100 milliseconds
110 counts the number of queries answered within 1 second
114 counts the number of queries answered by auth4s after 1 second (4.0)
118 counts the number of queries answered by auth4s within 1 millisecond (4.0)
122 counts the number of queries answered by auth4s within 10 milliseconds (4.0)
126 counts the number of queries answered by auth4s within 100 milliseconds (4.0)
128 auth4-answers100-1000
129 ^^^^^^^^^^^^^^^^^^^^^
130 counts the number of queries answered by auth4s within 1 second (4.0)
134 counts the number of queries answered by auth6s after 1 second (4.0)
138 counts the number of queries answered by auth6s within 1 millisecond (4.0)
142 counts the number of queries answered by auth6s within 10 milliseconds (4.0)
146 counts the number of queries answered by auth6s within 100 milliseconds (4.0)
148 auth6-answers100-1000
149 ^^^^^^^^^^^^^^^^^^^^^
150 counts the number of queries answered by auth6s within 1 second (4.0)
154 counts the number of queries to locally hosted authoritative zones (:ref:`setting-auth-zones`) since starting
158 size of the cache in bytes
162 shows the number of entries in the cache
166 counts the number of cache hits since starting, this does **not** include hits that got answered from the packet-cache
170 counts the number of cache misses since starting
174 counts the number of mismatches in character case since starting
178 number of queries chained to existing outstanding query
182 counts number of client packets that could not be parsed
186 shows the number of MThreads currently running
190 shows the number of milliseconds spent in thread n. Available since 4.1.12.
194 number of records dropped because of :ref:`setting-delegation-only` setting
196 dnssec-authentic-data-queries
197 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
198 .. versionadded:: 4.2
200 number of queries received with the AD bit set
202 dnssec-check-disabled-queries
203 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
204 .. versionadded:: 4.2
206 number of queries received with the CD bit set
210 number of queries received with the DO bit set
214 number of DNSSEC validations that had the Bogus state
216 dnssec-result-indeterminate
217 ^^^^^^^^^^^^^^^^^^^^^^^^^^^
218 number of DNSSEC validations that had the Indeterminate state
220 dnssec-result-insecure
221 ^^^^^^^^^^^^^^^^^^^^^^
222 number of DNSSEC validations that had the Insecure state
226 number of DNSSEC validations that had the NTA (negative trust anchor) state
230 number of DNSSEC validations that had the Secure state
234 number of DNSSEC validations performed
238 number of outgoing queries dropped because of :ref:`setting-dont-query` setting (since 3.3)
242 number of outgoing queries adorned with an EDNS Client Subnet option (since 4.1)
246 number of responses received from authoritative servers with an EDNS Client Subnet option we used (since 4.1)
248 ecs-v4-response-bits-*
249 ^^^^^^^^^^^^^^^^^^^^^^
250 .. versionadded:: 4.2.0
252 number of responses received from authoritative servers with an IPv4 EDNS Client Subnet option we used, of this subnet size (1 to 32).
254 ecs-v6-response-bits-*
255 ^^^^^^^^^^^^^^^^^^^^^^
256 .. versionadded:: 4.2.0
258 number of responses received from authoritative servers with an IPv6 EDNS Client Subnet option we used, of this subnet size (1 to 128).
262 number of servers that sent a valid EDNS PING response
266 number of servers that sent an invalid EDNS PING response
270 number of servers that failed to resolve
274 counts the number of non-query packets received on server sockets that should only get query packets
278 number of outgoing queries over IPv6
282 counts all end-user initiated queries with the RD bit set, received over IPv6 UDP
286 returns the number of bytes allocated by the process (broken, always returns 0)
290 currently configured maximum number of cache entries
292 max-packetcache-entries
293 ^^^^^^^^^^^^^^^^^^^^^^^
294 currently configured maximum number of packet cache entries
298 maximum amount of thread stack ever used
302 shows the number of entries in the negative answer cache
306 number of erroneous received packets
310 number of queries sent out without EDNS
314 counts the number of times it answered NOERROR since starting
318 number of queries sent out without ENDS PING
322 number of times an nsset was dropped because it no longer worked
326 shows the number of entries in the NS speeds map
330 counts the number of times it answered NXDOMAIN since starting
334 counts the number of timeouts on outgoing UDP queries since starting
338 counts the number of timeouts on outgoing UDP IPv4 queries since starting (since 4.0)
342 counts the number of timeouts on outgoing UDP IPv6 queries since starting (since 4.0)
346 questions dropped because over maximum concurrent query limit (since 3.2)
350 size of the packet cache in bytes (since 3.3.1)
354 size of packet cache (since 3.2)
358 packet cache hits (since 3.2)
362 packet cache misses (since 3.2)
366 packets dropped because of (Lua) policy decision
368 policy-result-noaction
369 ^^^^^^^^^^^^^^^^^^^^^^
370 packets that were not actioned upon by the RPZ/filter engine
374 packets that were dropped by the RPZ/filter engine
376 policy-result-nxdomain
377 ^^^^^^^^^^^^^^^^^^^^^^
378 packets that were replied to with NXDOMAIN by the RPZ/filter engine
382 packets that were replied to with no data by the RPZ/filter engine
384 policy-result-truncate
385 ^^^^^^^^^^^^^^^^^^^^^^
386 packets that were forced to TCP by the RPZ/filter engine
390 packets that were sent a custom answer by the RPZ/filter engine
394 shows the current latency average, in microseconds, exponentially weighted over past 'latency-statistic-size' packets
396 query-pipe-full-drops
397 ^^^^^^^^^^^^^^^^^^^^^
398 .. versionadded:: 4.2
400 questions dropped because the query distribution pipe was full
404 counts all end-user initiated queries with the RD bit set
408 .. versionadded:: 4.1.12
410 number of queries balanced to a different worker thread because the first selected one was above the target load configured with 'distribution-load-factor'
414 counts number of queries that could not be performed because of resource limits
418 security status based on :ref:`securitypolling`
422 counts number of server replied packets that could not be parsed
426 counts the number of times it answered SERVFAIL since starting
430 number of times PowerDNS considered itself spoofed, and dropped the data
434 number of CPU milliseconds spent in 'system' mode
438 number of times an IP address was denied TCP access because it already had too many connections
442 counts the number of currently active TCP/IP clients
446 counts the number of outgoing TCP queries since starting
450 counts all incoming TCP queries (since starting)
454 shows the number of entries in the throttle map
458 counts the number of throttled outgoing UDP queries since starting
462 idem to throttled-out
466 questions dropped that were too old
470 .. versionadded:: 4.2
472 questions dropped because they were larger than 512 bytes
476 .. versionadded:: 4.2
478 questions dropped because they had a QD count of 0
482 number of TCP questions denied because of allow-from restrictions
486 number of UDP questions denied because of allow-from restrictions
490 number of answers from remote servers that were unexpected (might point to spoofing)
494 number of times nameservers were unreachable since starting
498 number of seconds process has been running (since 3.1.5)
502 number of CPU milliseconds spent in 'user' mode
504 .. _stat-x-our-latency:
508 .. versionadded:: 4.2
510 Responses that were marked as 'variable'. This could be because of EDNS
511 Client Subnet or Lua rules that indicate this variable status (dependent on
512 time or who is asking, for example).
516 .. versionadded:: 4.1
517 Not yet proven to be reliable
519 PowerDNS measures per query how much time has been spent waiting on authoritative servers.
520 In addition, the Recursor measures the total amount of time needed to answer a question.
521 The difference between these two durations is a measure of how much time was spent within PowerDNS.
522 This metric is the average of that difference, in microseconds.
526 .. versionadded:: 4.1
527 Not yet proven to be reliable
529 Counts responses where between 0 and 1 milliseconds was spent within the Recursor.
530 See :ref:`stat-x-our-latency` for further details.
534 .. versionadded:: 4.1
535 Not yet proven to be reliable
537 Counts responses where between 1 and 2 milliseconds was spent within the Recursor.
538 See :ref:`stat-x-our-latency` for further details.
542 .. versionadded:: 4.1
543 Not yet proven to be reliable
545 Counts responses where between 2 and 4 milliseconds was spent within the Recursor. Since 4.1.
546 See :ref:`stat-x-our-latency` for further details.
550 .. versionadded:: 4.1
551 Not yet proven to be reliable
553 Counts responses where between 4 and 8 milliseconds was spent within the Recursor.
554 See :ref:`stat-x-our-latency` for further details.
558 .. versionadded:: 4.1
559 Not yet proven to be reliable
561 Counts responses where between 8 and 16 milliseconds was spent within the Recursor.
562 See :ref:`stat-x-our-latency` for further details.
566 .. versionadded:: 4.1
567 Not yet proven to be reliable
569 Counts responses where between 16 and 32 milliseconds was spent within the Recursor.
570 See :ref:`stat-x-our-latency` for further details.
574 .. versionadded:: 4.1
575 Not yet proven to be reliable
577 Counts responses where more than 32 milliseconds was spent within the Recursor.
578 See :ref:`stat-x-our-latency` for further details.