{"id":15286486,"url":"https://github.com/pstrobl96/prusa_exporter","last_synced_at":"2025-04-10T00:18:15.988Z","repository":{"id":159174228,"uuid":"622459510","full_name":"pstrobl96/prusa_exporter","owner":"pstrobl96","description":"Prometheus exporter for Prusa3D printers - supports Prusa Link API and Syslog metrics as well as logs from printer","archived":false,"fork":false,"pushed_at":"2025-01-26T19:24:29.000Z","size":13185,"stargazers_count":59,"open_issues_count":15,"forks_count":10,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-10T00:18:08.807Z","etag":null,"topics":["grafana","grafana-dashboard","prometheus","prometheus-exporter","prusa","prusa-link","syslog"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pstrobl96.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-04-02T07:08:01.000Z","updated_at":"2025-04-03T18:08:12.000Z","dependencies_parsed_at":null,"dependency_job_id":"c14730a6-99e6-48b6-a1e8-739693af7cbc","html_url":"https://github.com/pstrobl96/prusa_exporter","commit_stats":{"total_commits":172,"total_committers":8,"mean_commits":21.5,"dds":"0.34302325581395354","last_synced_commit":"70aea16d415ea655bf61c423e46ff4212ed9d890"},"previous_names":["pstrobl96/prusa_exporter","pstrobl96/buddy-prometheus-exporter"],"tags_count":45,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pstrobl96%2Fprusa_exporter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pstrobl96%2Fprusa_exporter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pstrobl96%2Fprusa_exporter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pstrobl96%2Fprusa_exporter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pstrobl96","download_url":"https://codeload.github.com/pstrobl96/prusa_exporter/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248131318,"owners_count":21052820,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["grafana","grafana-dashboard","prometheus","prometheus-exporter","prusa","prusa-link","syslog"],"created_at":"2024-09-30T15:15:10.322Z","updated_at":"2025-04-10T00:18:15.965Z","avatar_url":"https://github.com/pstrobl96.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![docker](https://img.shields.io/github/actions/workflow/status/pstrobl96/prusa_exporter/docker.yml)](https://github.com/pstrobl96/prusa_exporter/actions/workflows/docker.yml) \n[![rpi](https://img.shields.io/github/actions/workflow/status/pstrobl96/prusa_exporter/rpi.yml)](https://github.com/pstrobl96/prusa_exporter/actions/workflows/rpi.yml) \n![issues](https://img.shields.io/github/issues/pstrobl96/prusa_exporter) \n![go](https://img.shields.io/github/go-mod/go-version/pstrobl96/prusa_exporter) \n![tag](https://img.shields.io/github/v/tag/pstrobl96/prusa_exporter) \n![license](https://img.shields.io/github/license/pstrobl96/prusa_exporter)\n\n# THE REPOSITORY IS UNDER RECONSTRUCTION\n\n# prusa_exporter\n\nIf 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.\n\n- [ ] [prusa_metric_handler](https://github.com/pstrobl96/prusa_metrics_handler) integration for getting syslog metrics\n- [ ] [prusa_log_processor](https://github.com/pstrobl96/prusa_log_processor) integration for log processing\n- [ ] [prusa_exporter](https://github.com/pstrobl96/prusa_exporter) to process metrics from Prusa Link in addition to logs and syslog metrics. It's like a package for all three components.\n\n## Omega2\n\n*Why Omega?*\n\n*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.*\n\nThe 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. \n\n**prusa_metrics_handler** is configured in printer - Settings -\u003e Network -\u003e Metrics \u0026 Log\n\n- Host =\u003e address where prusa_metrics_handler is running\n- Metrics Port =\u003e default 8514 same as prusa_metrics_handler but you can change it\n- Enable Metrics =\u003e enable\n- Metrics List =\u003e list of enabled metrics\n  - You can select all but it has actual impact on performance so choose wisely\n\nList of metrics needed for dashboard\n- ttemp_noz\n- temp_noz\n- ttemp_bed\n- temp_bed\n- chamber_temp\n- temp_mcu\n- temp_hbr\n- loadcell_value\n- curr_inp\n- volt_bed\n- eth_out\n- eth_in\n\nOf course you can configure metrics with gcode as well\n\n```\nM330 SYSLOG\nM334 192.168.20.20\nM331 ttemp_noz\nM331 temp_noz\nM331 ttemp_bed\nM331 temp_bed\nM331 chamber_temp\nM331 temp_mcu\nM331 temp_hbr\nM331 loadcell_value\nM331 curr_inp\nM331 volt_bed\nM331 eth_out\nM331 eth_in\n```\n\n**prusa_exporter** is configured with [prusa.yml](docs/config/prusa.yml) where you need to fill - Settings -\u003e Network -\u003e PrusaLink\n\n- `address` of the printer\n- `username` =\u003e default `maker`\n- `password` for Prusa Link\n- `name` of the printer\n  - your chosen name =\u003e just use basic name non standard - type\n- `type` - model of the printer\n  - MK3.9 / MK4 / MK4S / XL / Core One ...\n\n### Dashboard\n\nPretty basic but nice and cozy [dashboard](docs/config/grafana/provisioning/dashboards/Prusa%20Metrics%20TV-1737915696031.json) for TV.\n\n![dashboard](docs/dashboard.png)\n\n---\n\n# OLD README.md\n\nThis 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.\n\nFor 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](https://github.com/prusa3d/Prusa-Link/releases).\n\n- [THE REPOSITORY IS UNDER RECONSTRUCTION](#the-repository-is-under-reconstruction)\n- [prusa\\_exporter](#prusa_exporter)\n  - [Omega2](#omega2)\n    - [Dashboard](#dashboard)\n- [OLD README.md](#old-readmemd)\n  - [Where to find prusa exporter](#where-to-find-prusa-exporter)\n  - [Roadmap](#roadmap)\n  - [How to install prusa exporter](#how-to-install-prusa-exporter)\n    - [Git Clone](#git-clone)\n    - [Docker Compose](#docker-compose)\n    - [Logs](#logs)\n    - [Metrics](#metrics)\n    - [Raspberry Pi](#raspberry-pi)\n    - [Starting](#starting)\n  - [Grafana Dashboards](#grafana-dashboards)\n    - [Prusa Link](#prusa-link)\n    - [Syslog](#syslog)\n    - [Overview](#overview)\n\n## Where to find prusa exporter\n\nPrusa exporter runs on port 10009, but you can choose different port in `prusa.yml`. Metrics are accessible at `/metrics` endpoint.\n\n## Roadmap\n\nThis list contains current and future features along with completion status:\n\n- [x] Scrape of metrics from [Prusa Link](https://github.com/prusa3d/Prusa-Link/tree/0.7.0rc3)\n- [x] Use of Grafana Cloud\n- [x] CI pipeline with Docker Hub publish\n- [x] Local instance of Grafana / Prometheus / Loki\n- [x] Raspberry Pi Image\n- [ ] Support for [connection](#21) to Einsy with username and password\n- [x] Support for MK3 - it was implemented before but I want overhaul it and make it work\n- [x] Dashboard update\n- [x] Configuration update\n- [x] Send logs to Grafana Cloud\n- [x] Enable node_exporter for Grafana Cloud\n- [x] Optimize and get more syslog metrics\n- [ ] Automatically send syslog config gcode to buddy boards \n- [ ] exporter toolkit implemenation\n- [ ] Create endpoint for configuration update\n- [ ] Unit tests\n- [ ] Create systemd service for exporter and install script\n- [ ] Properly provision on premise setup\n- [ ] CI for binaries release\n- [x] Enable log collection to Loki\n- [x] SL1 support\n\n## How to install prusa exporter\n\n### Git Clone\n\nFirst things first. You need to clone the repo and that which is very easy, right?\n\n`git clone https://github.com/pstrobl96/prusa_exporter.git`\n\n### Docker Compose\n\nI've created docker-compose.yaml file, that can be used for deploy of exporter. You would need [Docker](https://docs.docker.com/engine/install/) and [docker-compose](https://docs.docker.com/compose/install/linux/) 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.\n\n### Logs\n\nPrinter 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](docs/config.md) and [exporter.md](docs/exporter.md) \n\n### Metrics![dashboard](docs/examples/grafana/overview.png)\n\nMetrics 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](docs/config.md) and [exporter.md](docs/exporter.md) \n\nFor Buddy - SYSLOG exists. [Syslog](https://en.wikipedia.org/wiki/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.**\n\n**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. \n\nExample how metrics looks can be found in ![this](docs/examples/metrics_example.md) file. This file also includes Einsy and Buddy syslog metrics.\n\nHow to config Syslog metrics you can find in ![documentation](docs/syslog.md).\n\n### Raspberry Pi\n\nI also created Raspberry Pi image that can be flashed to memory card. If you choose this path you'll need following.\n\n- Raspberry Pi (*4 and 5 tested*) with 64 bit support\n- At least *Class 10* and at least *16 gigs* Memory card - preferably some kind of durable one\n\nOf course all other accessories like computer, card reader, power supply etc. are mandatory. How to flash Raspberry Pi image you can find in ![documentation](docs/rpi_image.md)\n\n### Starting\n\nStarting of exporter is simple. Just change directory to where docker-compose.yaml and configs are and run following command.\n\n```\ndocker compose up\n\n```\n\n:tada: if everthing went alright your instance is up and running and you can find metrics at [/metrics](http://localhost:10009/metrics) endpoint.\n\n## Grafana Dashboards\n\nI also prepared one dashboard per board which you can find in the [docs/examples/grafana](docs/examples/grafana) folder.\n\n### Prusa Link\n\nDownload this dashboard straight from [Grafana.net](https://grafana.com/grafana/dashboards/20393)! Just use ID `20393` when importing.  \n\n![dashboard](docs/examples/grafana/prusalink.png)\n\n### Syslog\n\nDownload this dashboard straight from [Grafana.net](https://grafana.com/grafana/dashboards/20618)! Just use ID `20618` when importing.  \n\n![dashboard](docs/examples/grafana/syslog.png)\n\n### Overview\n\nThis 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](https://github.com/grafana/grafana-polystat-panel) for this dashboard.\n\nDownload this dashboard straight from [Grafana.net](https://grafana.com/grafana/dashboards/20449)! Just use ID `20449` when importing.  \n\n![dashboard](docs/examples/grafana/overview.png)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpstrobl96%2Fprusa_exporter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpstrobl96%2Fprusa_exporter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpstrobl96%2Fprusa_exporter/lists"}