mirror of
https://github.com/deuill/coreos-home-server.git
synced 2024-09-21 21:50:46 +00:00
Alex Palaistras
011650105b
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.
17 lines
522 B
Desktop File
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
|