Create queries with the query builder
This feature isn’t available to all Chronosphere Observability Platform users and might not be visible in your app. For information about enabling this feature in your environment, contact Chronosphere Support.
Creating queries to find and analyze data from scratch can take time. To help with the task, Chronosphere includes a tool you can use to construct, optimize, and debug queries before saving, using, and sharing the queries with your team.
The query builder supports only Prometheus metrics, using PromQL.
The query builder is available in Metrics Explorer and when building queries in dashboards.
To open the tool, click Builder when writing a query in Observability Platform, which displays additional fields that update the contents of the query you’re working on. Any changes you make in the tool are sent to your original query.
You can add comments to annotate metrics with information to signify importance, help other users to understand usage context, and turn informal knowledge into institutional knowledge that can be used across your organization.
Expression section
The expression section contains the main query box for constructing your query, and the builder. If you type in the search boxes for each field, the builder autocompletes metric names, label names, label values, function names, operators, and modifiers as you type.
-
In the Metric box, add the information you want to query. The box opens a list of metrics you can select. To clear the query box, click Remove query at the end of the query box.
-
Add Filters. A filter is a Label and Value pair using an operator.
-
Optional. Add a Rollup function. These functions come from Rollup rules.
-
In the Aggregation menu, select an aggregation type from the following options:
avg
sum
max
min
-
Select the one or more labels to aggregate by.
-
As you construct a query expression, the charts update.
For additional query options, see Time series chart queries.