Skip to content

Prometheus exporter for Prusa3D printers - supports Prusa Link API and Syslog metrics as well as logs from printer

License

Notifications You must be signed in to change notification settings

pstrobl96/prusa_exporter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

docker rpi issues go tag license

THE REPOSITORY IS UNDER RECONSTRUCTION

prusa_exporter

If you've seen this repository before, you've probably noticed some minor changes. Basically I removed most of the features because feature-creep was getting worse and worse and I'm aiming for a simpler setup and much higher quality code, so version 1.0.0 is skipped and Vistaized - the first final version will be 2.0.0.

Omega2

Why Omega?

Omega development stage name was choosed when Microsoft d*cked up Windows Vista development and restarted the development. One of the first known builds was Omega13.

The Omega2 version is the one you could see at the Grafana / Prusa stand at FOSDEM 2025. This setup works for more than one printer, but the problem is that the prusa_metrics_handler is pretty greedy on computational resources. However, it works quite well for one printer - it should work for multiple printers, but it's not tested. I've set up one dashboard that works with metrics from both Prusa Link and prusa_metrics_handler, so both need to be configured.

prusa_metrics_handler is configured in printer - Settings -> Network -> Metrics & Log

  • Host => address where prusa_metrics_handler is running
  • Metrics Port => default 8514 same as prusa_metrics_handler but you can change it
  • Enable Metrics => enable
  • Metrics List => list of enabled metrics
    • You can select all but it has actual impact on performance so choose wisely

List of metrics needed for dashboard

  • ttemp_noz
  • temp_noz
  • ttemp_bed
  • temp_bed
  • chamber_temp
  • temp_mcu
  • temp_hbr
  • loadcell_value
  • curr_inp
  • volt_bed
  • eth_out
  • eth_in

Of course you can configure metrics with gcode as well

M330 SYSLOG
M334 192.168.20.20
M331 ttemp_noz
M331 temp_noz
M331 ttemp_bed
M331 temp_bed
M331 chamber_temp
M331 temp_mcu
M331 temp_hbr
M331 loadcell_value
M331 curr_inp
M331 volt_bed
M331 eth_out
M331 eth_in

prusa_exporter is configured with prusa.yml where you need to fill - Settings -> Network -> PrusaLink

  • address of the printer
  • username => default maker
  • password for Prusa Link
  • name of the printer
    • your chosen name => just use basic name non standard - type
  • type - model of the printer
    • MK3.9 / MK4 / MK4S / XL / Core One ...

Dashboard

Pretty basic but nice and cozy dashboard for TV.

dashboard


OLD README.md

This is an implementation of Prometheus Exporter for Prusa printers running Buddy boards (Prusa MK4, XL, and Mini), Einsy boards (Prusa MK3(S(+)) with Prusa Link installed) or resin printers (SL1). Multi-target is supported out of the box so you can check any number of printers as long it has accessible Prusa Link API and you have enough computing power.

For MK3S with Einsy board you need to use at least version 0.7.0 of Prusa Link or higher, because there are many more metrics to scrape than in the older versions. You can find the most up to date version in the Prusa Link repository.

Where to find prusa exporter

Prusa exporter runs on port 10009, but you can choose different port in prusa.yml. Metrics are accessible at /metrics endpoint.

Roadmap

This list contains current and future features along with completion status:

  • Scrape of metrics from Prusa Link
  • Use of Grafana Cloud
  • CI pipeline with Docker Hub publish
  • Local instance of Grafana / Prometheus / Loki
  • Raspberry Pi Image
  • Support for connection to Einsy with username and password
  • Support for MK3 - it was implemented before but I want overhaul it and make it work
  • Dashboard update
  • Configuration update
  • Send logs to Grafana Cloud
  • Enable node_exporter for Grafana Cloud
  • Optimize and get more syslog metrics
  • Automatically send syslog config gcode to buddy boards
  • exporter toolkit implemenation
  • Create endpoint for configuration update
  • Unit tests
  • Create systemd service for exporter and install script
  • Properly provision on premise setup
  • CI for binaries release
  • Enable log collection to Loki
  • SL1 support

How to install prusa exporter

Git Clone

First things first. You need to clone the repo and that which is very easy, right?

git clone https://github.com/pstrobl96/prusa_exporter.git

Docker Compose

I've created docker-compose.yaml file, that can be used for deploy of exporter. You would need Docker and docker-compose plugin installed. Right now it is possible to use docker compose up or if you want to try newest codebase, then just run sudo docker compose -f docker-compose.testing.yaml up --build --force-recreate that will build new docker image of exporter with Grafana Agent.

Logs

Printer logs and detailed metrics are sent via Syslog which is not best option but it is what it is. However to get data to Loki I need to process logs in exporter. I wanted to use Promtail for forwarding the logs to Loki however I was not successful with this approach because Promtail was throwing EOL errors so I forward logs into file in exporter and I configured Promtail to scrape and parse them. You can find how to configure logs in config.md and exporter.md

Metricsdashboard

Metrics that you can find in this exporter are "scraped" from two sources. First is Prusa Link, it is pretty usual REST API that returns all data in JSON. There is a lot of useful metrics but there are few that are missing. Like data from most of sensors and for example current or voltage. However this is not applicable to Einsy printers like MK3, these supports only Prusa Link API. As well as resin printers like SL1. You can find how to configure metrics in config.md and exporter.md

For Buddy - SYSLOG exists. Syslog is standard for logging for a quite while however printer used it for sending metrics. Trough UDP. So what I just did is that I created experimental Syslog UDP server within this exporter and I'm catching these "metrics". Be aware that these metrics can be send only via wired ethernet. You are out of luck over the air.

The issue is that if you have more printers you'll create a lot of UDP traffic in the network. If you have more printers this number multiplies. I choose flag this feature experimental because you cannot be sure you'll get the metrics, it's UDP and printers are sending data as much as they can but it is not consistent. Between printers there are differences - obvisouly.

Example how metrics looks can be found in this file. This file also includes Einsy and Buddy syslog metrics.

How to config Syslog metrics you can find in documentation.

Raspberry Pi

I also created Raspberry Pi image that can be flashed to memory card. If you choose this path you'll need following.

  • Raspberry Pi (4 and 5 tested) with 64 bit support
  • At least Class 10 and at least 16 gigs Memory card - preferably some kind of durable one

Of course all other accessories like computer, card reader, power supply etc. are mandatory. How to flash Raspberry Pi image you can find in documentation

Starting

Starting of exporter is simple. Just change directory to where docker-compose.yaml and configs are and run following command.

docker compose up

🎉 if everthing went alright your instance is up and running and you can find metrics at /metrics endpoint.

Grafana Dashboards

I also prepared one dashboard per board which you can find in the docs/examples/grafana folder.

Prusa Link

Download this dashboard straight from Grafana.net! Just use ID 20393 when importing.

dashboard

Syslog

Download this dashboard straight from Grafana.net! Just use ID 20618 when importing.

dashboard

Overview

This dashboard is used for monitoring all of your printers. Basically - green means printing, blue means ready, yellow means warning and red is error. You need polystat panel for this dashboard.

Download this dashboard straight from Grafana.net! Just use ID 20449 when importing.

dashboard

About

Prometheus exporter for Prusa3D printers - supports Prusa Link API and Syslog metrics as well as logs from printer

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published