Data Sources in Grafana
What you'll learn: How to connect Grafana to metrics backends like Prometheus so you can visualize your observability data.
What Are Data Sources?
Think of Grafana as a powerful display monitor and data sources as the various devices you can plug into it—each one provides different types of information. A data source is simply the backend system where your metrics, logs, or traces live. Grafana doesn't store data itself; it queries these external systems and transforms the results into beautiful visualizations.
Core Concept
When you configure a data source in Grafana, you're establishing a connection between Grafana and your metrics backend (like Prometheus, which you've learned about). This involves telling Grafana:
- Where the data source is (URL/endpoint)
- How to authenticate (credentials, tokens, or none)
- What type of data source it is (Prometheus, InfluxDB, CloudWatch, etc.)
Configuring a Data Source
In Grafana's UI, you navigate to Configuration → Data Sources and click "Add data source." For Prometheus specifically:
- Select "Prometheus" from the list
- Enter the Prometheus server URL (e.g.,
http://prometheus:9090) - Set authentication if needed (basic auth, API keys)
- Click "Save & Test" to verify connectivity
Once configured, this data source becomes available when building dashboards—you'll select it to write PromQL queries and create panels.
Common Data Sources
Beyond Prometheus, Grafana supports dozens of backends including MySQL, PostgreSQL, InfluxDB, Elasticsearch, and cloud providers like AWS CloudWatch. Each data source type has its own query language and capabilities.
Key Takeaway: Data sources are the bridge between Grafana's visualization layer and your actual metrics storage—configuring them correctly ensures you can query and display the observability data you've been collecting with tools like Prometheus.