Hello, I’m using Grafana OSS 9.2.4 with the Prometheus plugin 5.0.0 that ships with Grafana, on Linux.
I’m trying to provision my data sources and dashboards as code and I did the following:
- From a working instance, exported the Dashboard json (marked the option ‘Export for sharing externally’) and save it to a file
- On a new instance defined the data source as a YAML file, confirmed the datasource works on the new instance. it has the same name as the data source originally created by hand on the working instance.
- Deployed the dashboard JSON on the provisioning directory and see than the new dashboard is accepted by Grafana (all panels are there) but every single one of them is empty.
If I edit the new dashboard on the new server and change the data source by hand (and put back the query) then the panel works.
Somehow I think I missed an identifier that links the exported JSON with the new YAML data source definition.
My new Data source looks like this:
apiVersion: 1
datasources:
- name: Prometheus
type: prometheus
url: http://server.example.com:9090
access: proxy
editable: false
version: 1
jsonData:
manageAlerts: true
# prometheusType: Prometheus
# prometheusVersion: 2.40.0
httpMethod: POST
And the Dashboard JSON “seems” to have the same name:
{
"__inputs": [
{
"name": "DS_PROMETHEUS",
"label": "Prometheus",
"description": "",
"type": "datasource",
"pluginId": "prometheus",
"pluginName": "Prometheus"
}
],
"__elements": {},
"__requires": [
{
"type": "panel",
"id": "bargauge",
"name": "Bar gauge",
"version": ""
},
{
"type": "grafana",
"id": "grafana",
"name": "Grafana",
"version": "9.2.4"
},
{
"type": "panel",
"id": "piechart",
"name": "Pie chart",
"version": ""
},
{
"type": "datasource",
"id": "prometheus",
"name": "Prometheus",
"version": "1.0.0"
},
...
I don’t see any errors on the logs, did I missed any steps from the administration provisioning guide?
Thanks in advance.