Reputation: 1595
Every time we add a new producer to our system we manually need to add a new query for the associated panels in our Grafana dashboard to make the panel display a separate graph for the data coming from the new producer. With the number of producers growing this is tedious. Therefore the question whether there is some way in the Grafana API to add a query to an existing panel programmatically.
Upvotes: 1
Views: 1283
Reputation: 1305
One way (and maybe the only way) to do this is by creating/changing the dashboard JSON programmatically and updating the dashboard using the Dashboard HTTP API.
Basically you define a base dashboard and figure out how that JSON has to be modified every time a new producer is added (like changing a query, adding a panel, ...). Then you perform that action every time a new producer is added. Then you overwrite the existing dashboard with the new version via the API.
Upvotes: 2