A query returns data that Grafana visualizes in dashboards. After you create a panel and reports, Grafana automatically picks the default data source.
Procedure
- Click Dashboards and Reports.
- From the left pane, click the dashboard for which you want to add a query.
- Hover the mouse over the panel in which you want to add a query and click the vertical ellipse.
- Click Edit.
- Click the Data source drop-down menu, and select the data source.
- Click + Add Query.
- Click Query options to configure the maximum number of data points returned by the query and how frequently you want the query to request data from the data source.
- In the Query field, define the query as required.
- In the Metric field, select the required metrics.
- In the Group by field, select the parameters as required.
- Click Apply.