Provision a Data Source
A 3-step recipe with Grafana. We can help you get access.
Recipe · 3 steps
Provision a Data Source
with Grafana
Create a Grafana data source and verify it is healthy.
- Register the data source with the current organization. Grafana assigns an id and, when no UID is supplied, generates one.
- Read the data source back by UID to confirm it persisted and to capture the settings Grafana actually stored, which is what dashboards will reference.
- Ask Grafana to test the connection to the data source backend. This is the same check the Save & Test button runs in the UI, and it is what turns a silent misconfiguration into a failed pipeline step.
What you'll need to have ready
- name: Display name for the data source (e.g. "Prometheus - Prod").
- type: Data source plugin id (e.g. prometheus, loki, elasticsearch, postgres).
- url: The URL Grafana uses to reach the data source backend.
- access: How Grafana reaches the source; "proxy" (server side) or "direct".
- uid: Optional stable UID to assign. Supplying your own UID keeps dashboards portable across Grafana instances.
- isDefault: Whether this becomes the organization's default data source.
- basicAuth: Whether to send HTTP basic auth to the data source backend.
- basicAuthUser: Basic auth username, when basicAuth is enabled.
- jsonData: Non-secret plugin settings (e.g. httpMethod, timeInterval).
- secureJsonData: Secret plugin settings (e.g. basicAuthPassword, apiKey). Grafana stores these encrypted and never returns them on read.
For your developer
Arazzo workflow grafana:provision-datasource, 3 operations: addDataSource → getDataSourceByUID → checkDatasourceHealthWithUID. Specs on APIs.io.