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.

All Monitoring & Observability questions Roadmap: Monitoring & alerting

More on Grafana