Data sources
A data source in Grafana is a connection to a storage backend that holds your data, such as a Prometheus server, a Loki instance, a SQL database, or a cloud monitoring service. Grafana queries data sources to retrieve the stored data (e.g. metrics, logs, traces, and profiles) that it then visualizes in dashboards and Explore.
Grafana comes with built-in support for many data sources. If you need other data sources, you can also install one of the many data source plugins. If the plugin you need doesn’t exist, you can develop a custom plugin.
Each data source comes with a query editor, which formulates custom queries according to the source’s structure. After you add and configure a data source, you can use it as an input for many operations, including:
This documentation describes how to manage data sources in general, and how to configure or query the built-in data sources.
For other available plugins, refer to the list of documented plugins or browse the Plugin catalog. To develop a custom plugin, refer to Create a data source plugin.
Note
Grafana Cloud includes pre-configured data sources for Prometheus, Loki, and Tempo, so you can start querying without additional setup. Refer to Grafana Cloud documentation for details.
Manage data sources
Only users with the organization administrator role can add or remove data sources. To access data source management tools in Grafana as an administrator, navigate to Connections > Data sources in the left-side menu.
For details on data source management, including instructions on how to configure user permissions for queries, refer to the administration documentation.
By default, any user in an organization can query any data source in that organization. With Grafana Enterprise or Grafana Cloud, you can configure data source permissions to restrict query, edit, and admin access to specific users, teams, or roles. Refer to the data source management documentation for details.
Add a data source
Before you can create your first dashboard, you need to add your data source.
Note
Only users with the organization admin role can add data sources.
To add a data source:
- Click Connections in the left-side menu.
- Enter the name of a specific data source in the search dialog. You can filter by Data source to only see data sources.
- Click the data source you want to add.
- Configure the data source following instructions specific to that data source.
You can mark one data source as the Default by toggling the option on its configuration page. The default data source is pre-selected when you create new panels, navigate to Explore, or create alert rules.
Query editors
Each data source’s query editor provides a customized user interface that helps you write queries that take advantage of its unique capabilities. You use a data source’s query editor when you create queries in dashboard panels or Explore.
Because of the differences between query languages, each data source query editor looks and functions differently. Depending on your data source, the query editor might provide auto-completion features, metric names, variable suggestions, or a visual query-building interface.
For general information about querying in Grafana, and common options and user interface elements across all query editors, refer to Query and transform data.
Provision data sources
You can define and manage data sources as code using the Grafana provisioning system. This lets you configure data sources through YAML files or Terraform instead of the Grafana UI, which is useful for automated deployments and version-controlled configuration.
For more information, refer to Provision data sources.
Special data sources
Grafana includes three special data sources:
Grafana
A built-in data source that generates random walk data and can poll the TestData data source. Additionally, it can list files and get other data from a Grafana installation. This can be helpful for testing visualizations and running experiments.
Mixed
An abstraction that lets you query multiple data sources in the same panel. When you select Mixed, you can then select a different data source for each new query that you add.
- The first query uses the data source that was selected before you selected Mixed.
- You can’t change an existing query to use the Mixed data source.
With Grafana Play, you can explore and see how it works, learning from practical examples to accelerate your development. This feature can be seen on Mixed Datasources Example.
Dashboard
A data source that uses the result set from another panel in the same dashboard. The dashboard data source can use data either directly from the selected panel or from annotations attached to the selected panel.
With Grafana Play, you can explore and see how it works, learning from practical examples to accelerate your development. This feature can be seen on Panel as a Data Source.
Built-in core data sources
Grafana ships with the following core data sources, organized by their primary use case.
Metrics and time series
Logs
Traces
Profiles
SQL databases
Alerting
Testing and debugging
Add additional data source plugins
You can add additional data sources as plugins (that aren’t available in core Grafana), which you can install or create yourself.
Find data source plugins in the plugin catalog
To view available data source plugins, go to the plugin catalog and select the “Data sources” filter. For details about the plugin catalog, refer to Plugin management.
You can further filter the plugin catalog’s results for data sources provided by the Grafana community, Grafana Labs, and partners. If you use Grafana Enterprise, you can also filter by Enterprise-supported plugins.
For more documentation on a specific data source plugin’s features, including its query language and editor, refer to its plugin catalog page.
Create a data source plugin
To build your own data source plugin, refer to the Build a data source plugin tutorial and Plugin tools.
Correlate data across data sources
Grafana lets you link related data across different data sources so you can jump from one signal to another during investigations. For example, you can navigate from a trace span to related logs, or from a log line to metrics for the same service.
You can set up these links in two ways:
- Data source configuration: Tracing data sources like Tempo, Jaeger, and Zipkin include built-in settings for trace-to-logs, trace-to-metrics, and trace-to-profiles links.
- Correlations: A more flexible, general-purpose feature that lets you define rules to link data between any data sources. Refer to Correlations for details.
Troubleshoot data sources
If you run into issues with a data source, refer to Troubleshoot data sources for solutions to common problems like connection errors, authentication failures, and empty query results.
Each built-in data source also has its own troubleshooting page with guidance specific to that data source.
Next steps
After you’ve configured a data source, you can:
- Build a dashboard: Click the Build a dashboard drop-down list on the data source configuration page and select From suggestions to open a dialog box with suggested dashboards based on the data source type. For more information, refer to Create dashboards from suggestions or Create a dashboard.
- Explore your data: Use Explore to run free-form queries without creating a dashboard.
- Set up alerts: Create alert rules to get notified when your data meets certain conditions.
- Use template variables: Create dynamic, reusable dashboards with template variables.
- Add annotations: Overlay annotations on your graphs to mark events and correlate them with metrics.
- Transform query results: Apply transformations to manipulate and combine data from multiple sources.
- Enable query caching: Improve dashboard performance and reduce backend load with query and resource caching (available in Grafana Enterprise and Grafana Cloud).


