OctoPrint Exporter for Prometheus written in Golang
Simple GoLang-Application that exports Octoprint-Metrics into the Prometheus Format
This projects tries to create a simple way to integrate your 3D-Printer into your existing Prometheus Monitoring System.It present’s a standardized Prometheus Exporter to query.
To quickly run this application use the docker container localleon/octoprint-exporter
on hub.docker.com. Adjust the configs/config-example.yaml
file to your needs and run the container with it docker run --net=host -v "$(pwd)"/config.yaml:/bin/config.yaml localleon/octoprint-exporter:latest
.
Metrics are exposed under :9112/metrics and start with the prefix “octoprint” . The Metrics are a replicate from the Octoprint REST API.
Most relevant Metrics
The Status of the Printer is represented as Gauge
Prometheus Metric | OctoPrint Status |
---|---|
0 | Unknown |
1 | Operational |
2 | Printing from SD |
3 | Printing |
Currently tested on:
Use the provided build.sh with ‘./scripts/build.sh’ or build yourself with ‘go build . -o $BINNAME’
You need to provide all binarys with your own config file. An example of the config file can be found in configs/config-example.yaml
. Use the flag --config
to specify the path to the file.
ansible-playbook ./ansible-deploy.yaml
(tested on CentOS and Raspbian)docker build -t octoprint-exporter .
docker run --net=host octoprint-exporter
systemctl
to enable the ServiceCopyright localleon(c) 2019
This project is MIT Licensed