Hi Gert,
I don't know knot_exporter, but I guess you have to configure the module per
zone:
template:
- id: default
module: mod-stats
However, such a setup consumes more memory in the case of many zones.
Daniel
On 8/19/19 7:14 PM, Gert Doering wrote:
> Hiya,
>
> trying to get our knot dns server (FreeBSD pkg, 2.8.1) to export
> prometheus statistics.
>
> I found https://github.com/ghedo/knot_exporter, which looks promising
> (and I found that knot-resolver has this all built in, but this doesn't
> help me :-/ ).
>
> So, I've installed the required python modules, and when I start
> the knot_exporter (with the right paths and everything) it complains
> to me:
>
> $ /tmp/knot_exporter --web-listen-port 4041 --knot-library-path ...
> Traceback (most recent call last):
> File "/tmp/knot_exporter", line 489, in <module>
> args.knot_socket_timeout,
> File
> "/usr/local/lib/python3.6/site-packages/prometheus_client/registry.py", line
> 24, in register
> names = self._get_names(collector)
> File
> "/usr/local/lib/python3.6/site-packages/prometheus_client/registry.py", line
> 64, in _get_names
> for metric in desc_func():
> File "/tmp/knot_exporter", line 434, in collect
> for zone, zone_data in zone_stats["zone"].items():
> KeyError: 'zone'
>
>
> so, I read the manual, and it says that this should be sufficient:
>
> template:
> - id: default
> storage: /usr/local/etc/dnsmgmt/data/CA/knot
> disable-any: true
> acl: [ acl_transfer, acl_notify ]
> global-module: mod-stats
>
> with or without
>
> mod-stats:
> - id: default
> request-protocol: on
> server-operation: on
> edns-presence: on
> flag-presence: on
> response-code: on
> reply-nodata: on
> query-type: on
>
>
> ... but it does not seem to make a difference.
>
> So - if one of you has a working knot-server knot.conf that exports data
> to prometheus, can you share it?
>
> thanks,
>
> Gert Doering
> -- NetMaster
>
--
https://lists.nic.cz/mailman/listinfo/knot-dns-users