divinity666 / ruby-grafana-reporter

Reporting Service for Grafana
MIT License
66 stars 5 forks source link

Document in examples how to specify the value for a variable where the dashboard has variables to filter content by #36

Closed rcowham closed 4 months ago

rcowham commented 1 year ago

It was a little unclear to me how to do this, e.g. if a dashboard has a variable called serverid, and I want to get images for various values of that variable.

I discovered that this was actually quite easy - you just prefix "var-" and the name of your variable.

grafana_panel_image:1[dashboard="__some_ID",width="90%",var-serverid=main-server]
grafana_panel_image:1[dashboard="__some_ID",width="90%",var-serverid=replica-server]

The panel query PromQL expression might be:

node_load1{instance=~"$serverid"}

So same panel shown with different values.

Maybe this can be mentioned in the examples?

divinity666 commented 1 year ago

Thanks for the feedback! I will have a look, where this fits best.

divinity666 commented 4 months ago

I added a section in the readme to improve the documentation. Thanks for your feedback.