tg44 / OctoPrint-Prometheus-Exporter

An octoprint plugin for prometheus compatible metrics endpoint
MIT License
47 stars 21 forks source link

What unit does the extrusion counter use? #27

Closed aaaidan closed 2 years ago

aaaidan commented 2 years ago

I'm interested in knowing how many millimetres of filament have been extruded, and the octoprint_extrusion_total metric seems to be in some unit that gives very large numbers. Is it possibly in ... microsteps?

Assuming that is true, I have gotten some success dividing by plausible constants (number of microsteps, number of steps per rotation, distance of filament for a full rotation, ...). This has gotten me to match the expected extruded amounts for various jobs. But I still found I needed to add a mystery factor of 1000...

E.g. octoprint_extrusion_total{job="octoprint"} / 16 / 200 * 31.93 / 1000

Looking at the plugin source, it looks like it's just adding up all the gcode extrusions, so I would have expected it to already be in millimetres...

What unit is this metric in?

aaaidan commented 2 years ago

Ignore all my wild flailing trying to make the maths work. I was totally wrong!

My current conversion factor is ~49300. (exported / 49300 = extrusion in mm)

tg44 commented 2 years ago

25 we concluded that this is in micrometers, but still it could be different by machine and machine.

aaaidan commented 2 years ago

Thanks, I'll confirm it and post back on that issue.