nshttpd / mikrotik-exporter

prometheus mikrotik device(s) exporter
BSD 3-Clause "New" or "Revised" License
550 stars 153 forks source link

Gauge metrics are incorrectly reported as counters #117

Closed rkosegi closed 2 years ago

rkosegi commented 3 years ago

This is excerpt from collector output:

# HELP mikrotik_interface_actual_mtu actual-mtu
# TYPE mikrotik_interface_actual_mtu counter
# HELP mikrotik_interface_running running
# TYPE mikrotik_interface_running counter
# HELP mikrotik_system_cpu_load cpu-load
# TYPE mikrotik_system_cpu_load counter
# HELP mikrotik_system_free_hdd_space free-hdd-space
# TYPE mikrotik_system_free_hdd_space counter
# HELP mikrotik_system_free_memory free-memory
# TYPE mikrotik_system_free_memory counter
# HELP mikrotik_system_total_hdd_space total-hdd-space
# TYPE mikrotik_system_total_hdd_space counter
# HELP mikrotik_system_total_memory total-memory
# TYPE mikrotik_system_total_memory counter

None of mentioned metrics are counters, they are gauges.

I'm using docker image nshttpd/mikrotik-exporter:1.0.12-DEVEL

Alexx-G commented 3 years ago

IIRC they're created as counters, so technically these metrics should've been gauges but they're counters in the main branch.

rkosegi commented 3 years ago

IIRC they're created as counters, so technically these metrics should've been gauges but they're counters in the main branch.

Let me rephrase, none of metrics above represents monotonically incrementing values, so they shouldn't be created as counters.

nshttpd commented 3 years ago

Here's the question though, if I go and switch these from counters to gauges will that break dashboards across the land?

rkosegi commented 3 years ago

Here's the question though, if I go and switch these from counters to gauges will that break dashboards across the land?

It really depends on how query expressions in dashboards are used - but most likely no. As metrics mentioned above are not really counters, users most likely didn't used rate or similar aggregation functions on them in dashboards (it would really make no sense in the end)