To help with debugging queries, Explore allows you to investigate query requests and responses, as well as query statistics, via the Query inspector. This functionality is similar to the panel inspector tasks Inspect query performance and Inspect query request and response data.
Query history is a list of queries that you used in Explore. The history is stored in the FojiSoft database, and it is not shared with other users. The retention period for queries in history is two weeks. Queries older than two weeks are automatically deleted. To open and interact with your history, click the Query history button in Explore.
Note: Starred queries are not subject to the two weeks retention period and they are not deleted.
Query history lets you view the history of your querying. For each individual query, you can:
All queries that have been starred in the Query history tab are displayed in the Starred. This allows you to access your favorite queries faster and to reuse these queries without typing them from scratch.
By default, query history shows you the most recent queries. You can sort your history by date or by data source name in ascending or descending order.
Filter query history in Query history and Starred tab by data source name:
In Query history tab it is also possible to filter queries by date using the slider:
You can search in your history across queries and your comments. Search is possible for queries in the Query history tab and Starred tab.
You can customize the query history in the Settings tab. Options are described in the table below.
Setting
Default value
Change the default active tab
Query history tab
Note: Query history settings are global, and applied to both panels in split mode.
The first version of Explore features a custom querying experience for Prometheus. When a query is executed, it executes two queries, a normal Prometheus query for the graph and an Instant Query for the table. An Instant Query returns the last value for each time series which shows a good summary of the data shown in the graph.
On the left side of the query field, click Metrics to open the Metric Explorer. This shows a hierarchical menu with metrics grouped by their prefix. For example, all Alert manager metrics are grouped under the alert manager prefix. This is a good starting point if you just want to explore which metrics are available.
The Query field supports autocomplete for metric names and functions, comparable to the standard Prometheus query editor. Press the Enter key to create a new line and Shift+Enter to execute a query.
The autocomplete menu can be triggered by pressing Ctrl+Space. The Auto completemenu contains a new History section with a list of recently executed queries.
Suggestions can appear under the query field - click on them to update your query with the suggested change.
Click on the filter button in the “label” column of a Table panel to add filters to the query expression. You can add filters for multiple queries as well - the filter is added for all the queries.