Builder
The builder contains fields that represent key parts of a PromQL query. As you type in the search boxes for each field, the builder suggests metric names, label names, label values, and function names.Create the query
Use the text boxes to add values which create the PromQL query:-
Click the Select a metric box next to Metric. A list of selectable
metrics opens. Choose a metric, or search for one.
When reviewing a metric for selection, an additional window opens to the side
of the search menu. This window displays:
- The type of metric (for example, gauge).
- A Description. Click the pencil icon to add or edit a description and then click Save.
- A list of Labels this metric has.
- To add a comment to a metric, click Add comment.
- A link to open the Telemetry Usage Analyzer.
- To add Filters, click the No filters box. A filter is a Label and Value pair that selects a subset of the data. Click the check icon to add the filter. To add another filter, click the plus icon.
-
In the Aggregation menu, you will see options depending on the type of metric.
If you chose a gauge metric or a counter metric (cumulative counter or delta counter),
select from the following options:
SumAverageMinMax
PercentileAverageCount
-
In the Rollup menu, you will see additional functions depending on the type of metric.
After you select a metric, the builder checks for type information.
If the type is available, it applies the most appropriate Rollup option.
If the type isn’t available, you must manually select an option.
Chronosphere recommends the following settings:
- Cumulative counter or cumulative exponential histogram: Use
rateorincrease. - Delta counter or delta exponential histogram: Use
sum_per_secondorsum_over_time. - Gauge: Don’t use any of these functions.
- Cumulative counter or cumulative exponential histogram: Use
- Click Run to run the query. If the graph is in a dashboard, the graph updates as you make changes.
Remove values
To clear any field, click close icon at the end of the field. To reset to the default value, click the field value and then click Reset.Query actions
Additional actions are available to help build the query you need. These actions vary depending on where you accessing the query builder from, such as from Metrics Explorer, or from within a dashboard panel.- DDx: Use Differential Diagnosis for metrics to review your query for correlated labels and values.
- Browse metrics: Open a dialog box where you can search for a specific metric. Click a metric name to view details for that metric.
- Format: In dashboard panels this action formats the query.