prometheus metrics are all gauges
Metrics that should be a counter are also gauges. This results in the inability to use functions like rate
to get the queries/sec, as these functions only works with metrics of type counter.
The metrics endpoint is currently automatic generated form metrics knot provides. Therefore, it is not straight forward to define the type. Probably a hard mapping is required.
Example with current and required behavior:
# HELP knot_query_type
- # TYPE knot_query_type gauge
+ # TYPE knot_query_type counter
knot_query_type{section="mod-stats",type="SOA"} 25.0
knot_query_type{section="mod-stats",type="PTR"} 97.0
Edit: I am willing to provide a Pull Request after a possible solution has been discussed.