community.grafana icon indicating copy to clipboard operation
community.grafana copied to clipboard

add support for dashboard inputs

Open gbolo opened this issue 9 months ago • 0 comments

SUMMARY

Currently, the web UI in Grafana supports providing inputs when importing dashboards. for example, a dashboard json may have a body containing:

...
  "__inputs": [
    {
      "name": "DS_PROMETHEUS",
      "label": "Prometheus",
      "description": "",
      "type": "datasource",
      "pluginId": "prometheus",
      "pluginName": "Prometheus"
    }
  ]
...

In the same body it can reference those inputs like: "datasource": "${DS_PROMETHEUS}".

When using the web UI in Grafana, it interprets these inputs and allows you to fill them in with a drop down menu. Then when it makes the POST /api/dashboards/import call, it will have the values for those inputs in the body like:

...
  "inputs": [
    {
      "name": "DS_PROMETHEUS",
      "type": "datasource",
      "pluginId": "prometheus",
      "value": "2bc3bb07-e974-5690-9826-c71ae0fdb03a"
    }
  ]
...
ISSUE TYPE
  • add a parameter to the community.grafana.grafana_dashboard module to support supplying the input part of the request body.
COMPONENT NAME

community.grafana.grafana_dashboard

ADDITIONAL INFORMATION

For example, see this dashboard: https://grafana.com/grafana/dashboards/405-node-exporter-server-metrics/

gbolo avatar Nov 14 '23 20:11 gbolo