lightninglabs / lndmon

🔎lndmon: A drop-in monitoring solution for your lnd node using Prometheus+Grafana
MIT License
149 stars 47 forks source link

Programmatically set Grafana default dashboard #6

Closed valentinewallace closed 4 years ago

valentinewallace commented 4 years ago

This isn't configurable via grafana.ini but it is technically configurable through Grafana's API.

Steps:

  1. Add a docker container that depends_on Grafana's container to docker-compose
  2. In this docker container, first get the desired dashboard ID through this API using the UID of the desired dashboard.
  3. Use this API to update the user's home dashboard ID to the ID you just retrieved.

You should receive the response {"message":"Preferences updated"} and the container can exit after that.

More info on why step 2 is necessary: https://grafana.com/docs/http_api/dashboard/#identifier-id-vs-unique-identifier-uid