summaryrefslogtreecommitdiffstats
path: root/src/knot/modules/stats/stats.rst
blob: 8acf1aa50e680da1ba0b7f2271ca1f6a479cbd6e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
.. _mod-stats:

``stats`` — Query statistics
============================

The module extends server statistics with incoming DNS request and corresponding
response counters, such as used network protocol, total number of responded bytes,
etc (see module reference for full list of supported counters).
This module should be configured as the last module.

.. NOTE::
   Server initiated communication (outgoing NOTIFY, incoming \*XFR,...) is not
   counted by this module.

.. NOTE::
   Leading 16-bit message size over TCP is not considered.

Example
-------

Common statistics with default module configuration::

    template:
      - id: default
        global-module: mod-stats

Per zone statistics with explicit module configuration::

    mod-stats:
      - id: custom
        edns-presence: on
        query-type: on

    template:
      - id: default
        module: mod-stats/custom

Module reference
----------------

::

 mod-stats:
   - id: STR
     request-protocol: BOOL
     server-operation: BOOL
     request-bytes: BOOL
     response-bytes: BOOL
     edns-presence: BOOL
     flag-presence: BOOL
     response-code: BOOL
     request-edns-option: BOOL
     response-edns-option: BOOL
     reply-nodata: BOOL
     query-type: BOOL
     query-size: BOOL
     reply-size: BOOL

.. _mod-stats_id:

id
..

A module identifier.

.. _mod-stats_request-protocol:

request-protocol
................

If enabled, all incoming requests are counted by the network protocol:

* udp4 - UDP over IPv4
* tcp4 - TCP over IPv4
* quic4 - QUIC over IPv4
* udp6 - UDP over IPv6
* tcp6 - TCP over IPv6
* quic6 - QUIC over IPv6
* udp4-xdp - UDP over IPv4 through XDP
* tcp4-xdp - TCP over IPv4 through XDP
* quic4-xdp - QUIC over IPv4 through XDP
* udp6-xdp - UDP over IPv6 through XDP
* tcp6-xdp - TCP over IPv6 through XDP
* quic6-xdp - QUIC over IPv6 through XDP

*Default:* ``on``

.. _mod-stats_server-operation:

server-operation
................

If enabled, all incoming requests are counted by the server operation. The
server operation is based on message header OpCode and message query (meta) type:

* query - Normal query operation
* update - Dynamic update operation
* notify - NOTIFY request operation
* axfr - Full zone transfer operation
* ixfr - Incremental zone transfer operation
* invalid - Invalid server operation

*Default:* ``on``

.. _mod-stats_request-bytes:

request-bytes
.............

If enabled, all incoming request bytes are counted by the server operation:

* query - Normal query bytes
* update - Dynamic update bytes
* other - Other request bytes

*Default:* ``on``

.. _mod-stats_response-bytes:

response-bytes
..............

If enabled, outgoing response bytes are counted by the server operation:

* reply - Normal response bytes
* transfer - Zone transfer bytes
* other - Other response bytes

.. WARNING::
   Dynamic update response bytes are not counted by this module.

*Default:* ``on``

.. _mod-stats_edns-presence:

edns-presence
.............

If enabled, EDNS pseudo section presence is counted by the message direction:

* request - EDNS present in request
* response - EDNS present in response

*Default:* ``off``

.. _mod-stats_flag-presence:

flag-presence
.............

If enabled, some message header flags are counted:

* TC - Truncated Answer in response
* DO - DNSSEC OK in request

*Default:* ``off``

.. _mod-stats_response-code:

response-code
.............

If enabled, outgoing response code is counted:

* NOERROR
* ...
* NOTZONE
* BADVERS
* ...
* BADCOOKIE
* other - All other codes

.. NOTE::
   In the case of multi-message zone transfer response, just one counter is
   incremented.

.. WARNING::
   Dynamic update response code is not counted by this module.

*Default:* ``on``

.. _mod-stats_request-edns-option:

request-edns-option
...................

If enabled, EDNS options in requests are counted by their code:

* CODE0
* ...
* EDNS-KEY-TAG (CODE14)
* other - All other codes

*Default:* ``off``

.. _mod-stats_response-edns-option:

response-edns-option
....................

If enabled, EDNS options in responses are counted by their code. See
:ref:`mod-stats_request-edns-option`.

*Default:* ``off``

.. _mod-stats_reply-nodata:

reply-nodata
............

If enabled, NODATA pseudo RCODE (:rfc:`2308#section-2.2`) is counted by the
query type:

* A
* AAAA
* other - All other types

*Default:* ``off``

.. _mod-stats_query-type:

query-type
..........

If enabled, normal query type is counted:

* A (TYPE1)
* ...
* TYPE65
* SPF (TYPE99)
* ...
* TYPE110
* ANY (TYPE255)
* ...
* TYPE260
* other - All other types

.. NOTE::
   Not all assigned meta types (IXFR, AXFR,...) have their own counters,
   because such types are not processed as normal query.

*Default:* ``off``

.. _mod-stats_query-size:

query-size
..........

If enabled, normal query message size distribution is counted by the size range
in bytes:

* 0-15
* 16-31
* ...
* 272-287
* 288-65535

*Default:* ``off``

.. _mod-stats_reply-size:

reply-size
..........

If enabled, normal reply message size distribution is counted by the size range
in bytes:

* 0-15
* 16-31
* ...
* 4080-4095
* 4096-65535

*Default:* ``off``