restic / rest-server

Rest Server is a high performance HTTP server that implements restic's REST backend API.
BSD 2-Clause "Simplified" License
922 stars 138 forks source link

Make dashboard portable #202

Closed deajan closed 1 year ago

deajan commented 1 year ago

What is the purpose of this change? What does it change?

Allows to select datasource when first importing into grafana, thus making the dashboard portable.

Was the change discussed in an issue or in the forum before?

Don't think this was discussed anywhere

Checklist

wojas commented 1 year ago

Thanks! Do you have a link that documents this?

I find the ${DS_PROMETHEUS-INFRA} with - a bit weird and I cannot find this exact name anywhere. I can find mentions of DS_PROMETHEUS, but mostly from people that have issues with it and had to replace it manually with the actual name. Is there a minimum Grafana version for this?

Does https://github.com/restic/rest-server/tree/master/examples/compose-with-grafana still work with this?

deajan commented 1 year ago

I actually could have chosen any variable name as long as I specify it in "__inputs" part of the json file. DS_PROMETHEUS must be included in the JSON file, which I did.

To be honest, I don't know what minimum version of grafana is required for this to work (I use 9.x).

I cannot guarantee this will work with your current composer setup, but should work since you ask to define a datasource named prometheus, which is the default I setup the DS_PROMETHEUS variable with.

deajan commented 1 year ago

You could actually make the dashboard portable itself by exporting it's JSON, see https://stackoverflow.com/questions/54776604/how-can-i-change-the-datasource-for-a-grafana-dashboard