kea-exporter
kea-exporter copied to clipboard
fix: change packets metrics to counter
fix: #52
This PR is based on my interpretation of metrics from the documentation, as the descriptions for some metrics are not very clear.
Based on :
- https://kea.readthedocs.io/en/kea-2.5.6/arm/dhcp4-srv.html#statistics-in-the-dhcpv4-server
- https://kea.readthedocs.io/en/kea-2.5.6/arm/dhcp6-srv.html#statistics-in-the-dhcpv6-server
I think it looks good. @mweinelt will have to check and provide feedback.
Sorry for not getting back to you. I'm not super convinced about the overflow handling. Is that really something we have to handle ourselves, or does the client library offer some functionality here?
No problems :)
Regarding the overflow, it's something we need to address if we want to handle certain cases. We have two choices:
- Don't handle counter resets as we can't catch them all the time.
- Handle them with some logic, which I think should catch most of the cases (current implementation).
The library doesn't deal with counter resets; we have to trigger it ourselves. See https://github.com/prometheus/client_python/issues/995.