Grafana Cloud Enterprise Open source
Last reviewed: March 10, 2026

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 (for example, 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:

  1. Click Connections in the left-side menu.
  2. Enter the name of a specific data source in the search dialog. You can filter by Data source to only see data sources.
  3. Click the data source you want to add.
  4. 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

This built-in data source generates random walk data and can poll the TestData data source. It can also list files and retrieve other data from a Grafana installation, making it useful for testing visualizations and running experiments.

In a panel query, the Grafana data source supports the following query types, which you select in the query editor:

  • Random walk: Generate a random time series signal within the selected time range, which is useful for testing panels and visualizations.
  • Live measurements: Stream real-time measurements from Grafana Live channels.
  • List public files: Show directory listings for public resources served by the Grafana installation.

When you add an annotation query in a dashboard’s settings, the Grafana data source supports the following additional query types:

  • Annotations and alerts: Return annotations or alerts managed by Grafana, filtered either by the current dashboard or by tags.
  • Time regions: Highlight a repeating time region, such as business hours or weekends.

You don’t select the Snapshot query type manually. Grafana uses it automatically to display the data captured in a dashboard snapshot.

Mixed

This data source lets you query multiple data sources in the same panel. When you select Mixed, you can select a different data source for each new query that you add. This is useful when you want to compare or combine data from different backends in a single visualization, such as metrics from Prometheus alongside logs from Loki.

Each query runs against its own data source using that data source’s query editor, and Grafana runs the queries in parallel. If one query fails, the others still return results, and the failed query reports an error labeled with its data source name.

Note the following behavior:

  • 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.
Give it a try using Grafana Play
Give it a try using Grafana Play

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

This data source reuses the result set from another panel in the same dashboard. Instead of running its own query against a backend, a panel using the Dashboard data source points to a source panel and works with the data that panel already returned.

Because it depends on another panel in the same dashboard, the Dashboard data source is only available when you edit a panel within a dashboard. It doesn’t appear in Explore.

The Dashboard data source references the complete output of another panel. It doesn’t chain one query into another within a single panel, so you can’t feed the results of one query into a second query as an input. To reshape or narrow the referenced data, apply transformations in the panel that uses the Dashboard data source.

Use the Dashboard data source when you want to:

  • Share query results: Point several panels at one source panel so Grafana runs a single query and reuses the results, which reduces the number of queries sent to your backend. For details, refer to Share query results with another panel.
  • Filter unsupported data: Reference a panel whose data source doesn’t support the use of filters, then filter the referenced data in the new panel. For details, refer to Filter any data using the Dashboard data source.

When you configure the Dashboard data source, you set the following options:

  • Source panel: The panel whose results you want to reuse.
  • Data: Select All data to use the source panel’s query results, or select annotations to use only the annotations attached to that panel.
Give it a try using Grafana Play
Give it a try using Grafana Play

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).