What is a Grafana datasource and how do you provision one?
BeginnerConceptGrafana
Answer
A datasource is a configured connection to a backend. Provision it as code from /etc/grafana/provisioning/datasources/:
apiVersion: 1
datasources:
- name: Prometheus
uid: prom-main
type: prometheus
access: proxy
url: http://prometheus:9090
isDefault: true
jsonData:
timeInterval: 15s
Setting a fixed uid lets dashboards reference the datasource stably across environments. timeInterval should match the scrape interval.
More on Grafana
What is Grafana and what is it not?BeginnerWhat are dashboard variables and what types exist?IntermediateHow do multi-value and "All" variables work in PromQL queries?IntermediateWhat are Grafana's built-in time variables?IntermediateWhat does "dashboards as code" mean and what are the options?IntermediateHow do you provision dashboards from files?Beginner