scross01 / prometheus-klipper-exporter

Prometheus Exporter for Klipper
MIT License
51 stars 12 forks source link

mcu_task_avg and mcu_task_stddev are not reported #37

Closed Wulfsta closed 1 week ago

Wulfsta commented 1 month ago

I see that when mcu metrics were added these two were left commented out, and are to this day. Is there a technical reason for this? I would like them to be available given their use to compute and graph the mcu load heuristic.

scross01 commented 1 week ago

These where left out based on the Prometheus exporter documentation guidance to drop summary metrics and use prometheus to calculate averages if needed:

https://prometheus.io/docs/instrumenting/writing_exporters/#drop-less-useful-statistics

Some instrumentation systems expose 1m, 5m, 15m rates, average rates since application start (these are called mean in Dropwizard metrics for example) in addition to minimums, maximums and standard deviations. These should all be dropped, as they’re not very useful and add clutter. Prometheus can calculate rates itself, and usually more accurately as the averages exposed are usually exponentially decaying.

I don't have any issues with adding them in if they are useful

Wulfsta commented 1 week ago

I don’t think that applies here; these metrics are effectively calculated by the mcu, and the variance from each stats report (at a 1s interval when printing) is used in a heuristic to estimate load. It might be possible to get this data over a longer interval with prometheus, but I’m not sure it would be possible to replicate an accurate load graph like that?

scross01 commented 1 week ago

Fixed in release v0.12.0

Thanks for the PR!