Statistics collector¶
This module gathers various counters from the query resolution and server internals, and offers them as a key-value storage.
monitoring:
enabled: always
These metrics can be either exported to Graphite/InfluxDB/Metronome or exposed as Prometheus metrics endpoint.
- monitoring:¶
- enabled: manager-only|lazy|always¶
- Default:
lazy
Configures, whether statistics module will be loaded into resolver.
manager-only
- Disables statistics collection in all kresd workers.lazy
- Statistics collection is enabled at the time of request.always
- Statistics collection is always on.
You can see all built-in statistics in Built-in statistics section.
Prometheus metrics endpoint¶
The HTTP API exposes /metrics endpoint that serves agregated metrics from statistics collector in Prometheus text format. You can use it as soon as the HTTP API is configured.
It is also possible to use the kresctl utility to obtain and save metrics:
$ kresctl metrics ./metrics/data.txt
Graphite/InfluxDB/Metronome¶
The Graphite module sends statistics over the Graphite protocol to either Graphite, Metronome, InfluxDB or any compatible storage. This allows powerful visualization over metrics collected by Knot Resolver.
Tip
The Graphite server is challenging to get up and running, InfluxDB combined with Grafana are much easier, and provide richer set of options and available front-ends. Metronome by PowerDNS alternatively provides a mini-graphite server for much simpler setups.
Example configuration:
monitoring:
graphite:
host: 127.0.0.1 # graphite server address
port: 200 # optional graphite server port (2003 is default)
interval: 5s # optional publish interval (5s is default)
- monitoring/graphite: <graphite-config>|false¶
- Default:
false
Graphite module is disabled by default. It is automatically enabled when configured.
- host: <address or hostname>¶
Graphite server IP address or hostname.
- port: <port>¶
- Default:
2003
Optional, Graphite server port.
- prefix: <string>¶
- Default:
“”
Optional prefix for all kresd workers. Worker ID is automatically added for each process.
- interval: <time ms|s|m|h|d>¶
- Default:
5s
Optional publishing interval.
- tcp: true|false¶
- Default:
false
Optional, set to true if you want TCP mode.