coreos-home-server/service/grafana/systemd/grafana-dashboard@.service
Alex Palaistras 011650105b Implement metrics with Grafana and Prometheus
This commit adds two services, `grafana` and `prometheus`, and sets up
some existing services (`dovecot` and `prosody`) to expose metrics into
Grafana. In addition, systemd services have been added to facilitate
registering metrics for services into Prometheus, as well as
automatically provisioning Grafana dashboards based on static JSON
representations.

This work will continue to evolve as more services gain proper Grafana
dashboards, and Loki is also integrated for access to the systemd
journal.
2022-04-25 20:12:06 +01:00

17 lines
522 B
Desktop File

[Unit]
Description=Register Grafana Dashboard for %I
Wants=grafana.service
After=grafana.service
ConditionPathExists=%E/coreos-home-server/%i/service/%p.json
[Service]
Type=oneshot
RemainAfterExit=true
SyslogIdentifier=%N
ExecStartPre=/bin/podman exec grafana mkdir -p /var/lib/grafana/dashboards
ExecStart=/bin/podman cp %E/coreos-home-server/%i/service/%p.json grafana:/var/lib/grafana/dashboards/%i.json
ExecStop=/bin/podman exec grafana rm -f /var/lib/grafana/dashboards/%i.json
[Install]
WantedBy=multi-user.target