mirror of
https://github.com/hikhvar/mqtt2prometheus.git
synced 2026-02-14 09:59:52 +00:00
This change adds the new option `force_monotonicy` to metric configurations. It is intended for almost-but-not-really monotinic sources, such as counters which reset when the sensor is restarted. When this option is set to `true`, the source metric value is regularly written to disk. This allows us to detect and compensate counter resets even between restarts. When a reset is detected, the last value before the reset becomes the new offset, which is added to the metric value going forth. The result is a strictly monotonic time series, like an ever increasing counter.