Klipper: Instrument Klipper to expose metrics

Created on 2 Oct 2018  路  8Comments  路  Source: KevinOConnor/klipper

This is more of a feature request / conversation starter.

It would be very interesting to get certain metrics out of Klipper. Initially I'm thinking things like:

  • a counter for number of instructions sent over the serial (so we could get rates, totals and other goodies - potentially cross-reference with things like buffer queues etc to help diagnose issues with starvation).
  • temperatures (bed, extruder(s))
  • process data (memory used, threads, whatever other things make sense)
  • other metrics?

Ideally for me it would be exposed in Prometheus format.

I already run node_exporter on the Pi's and can get a lot for free there but nothing specific to the print jobs and the printers. Prometheus scrapes them and I can create nice dashboards in Grafana.

Most helpful comment

Klipper has a modular addon system (called extras) which allows to easily write addons in python that can interact with the klipper code. Check /klippy/extras/ for the existing ones.

All 8 comments

Some of this information is already available in the log file. You can generate a log graph that includes bandwidth, host buffer, and MCU load information. Temperatures are also in the log file, and I'm sure they can be extracted fairly easily.

https://github.com/KevinOConnor/klipper/blob/master/docs/Debugging.md

Extras can access pretty much all the metrics you mentioned and export in whatever means python is capable of.

I suggest you look into writing an extra for Klipper.

@jakep82 I'll see if I can extract that info and expose in a Prometheus format, thanks.

@FHeilmann What do you mean by extras?

It looks like I could use the Grok exporter to parse the log and expose metrics.

Klipper has a modular addon system (called extras) which allows to easily write addons in python that can interact with the klipper code. Check /klippy/extras/ for the existing ones.

the octoklipper module offers a performance graph feature that displays:
-MCU loads

  • bandwith
  • buffer
  • ...

I know. I want to export those metrics so I can add them to my Pi's dashboards with CPU, I/O, networking, load, etc metrics, then I can post annotations to it and make correlations, have historical data, etc.

It seems the original question was answered, so I'm going to close this.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

leungtech picture leungtech  路  4Comments

SergeyKrutyko picture SergeyKrutyko  路  6Comments

CHILLYSMOKES picture CHILLYSMOKES  路  5Comments

aegelsky picture aegelsky  路  3Comments

Michael-Bell picture Michael-Bell  路  5Comments