Run PromQL queries in the Wavefront Query Editor

Starting with release 2020.26, Wavefront includes support for PromQL. In this Beta of PromQL you can:

  • Run PromQL queries directly in the Wavefront Query Editor. The Query Editor parses the query correctly depending on the syntax elements (PromQL or Wavefront QL) it encounters. The corresponding chart shows the information you’d expect. There is no other indication in the UI whether the query is Wavefront QL or PromQL.
  • Add charts that use PromQL to dashboards.
  • Create alerts from charts that use PromQL
  • Use PromQL queries in the query line of a Create Alert page.

How to Use PromQL Queries

  1. Create or edit a chart.
  2. Start typing your PromQL query.
  3. Make changes to the visualization.

Prometheus query

How PromQL Queries Can Differ in Wavefront.

Wavefront supports most PromQL functions and operators out of the box. There are a small number of differences.

sort(), sort_desc() PromQL sort() and sort_desc() show the data order in the Console view. Because Wavefront visualizes queries in charts instead of a console, we don't support this option.
count_values() The PromQL count_values aggregation function is not supported. Wavefront histograms and histogram functions allow you to perform the corresponding tasks -- and more!
topk(), bottomk() The topk() and bottomk() functions work slightly differently in PromQL and Wavefront query language.
  • PromQL computes topk() and bottomk() at the point level. It picks the top points at each timestamp.
  • Wavefront computes topk() and bottomk() at time series level. It returns the top or bottom series (based on the avg/min/max... value).

In the Wavefront Query Editor, topk() and bottomk() always return results based on the time series.

ignore, on, group_left, group_right Wavefront does not support ignore, on, group_left, group_right for vector matching with Prometheus queries.
=~, !~ Wavefront does not support instant vector selectors (=~, !~) for regex matching in labels. However, you can use wildcard characters in PromQL queries.
subquery Wavefront does not support the PromQL subquery feature.

Limitations

While you can run queries directly in the Wavefront Query Editor, there are currently a few limitations.

  • Autocomplete is not currently supported for PromQL functions and operators. However, autocomplete for metrics that you use inside your query continues to be supported.
  • The Wavefront query language supports using a query name as a chart variable in other queries for the same chart.
    • You can use a query name as a chart variable in a PromQL query if the named query was also a PromQL query.
    • You cannot use a query name as a chart variable if the named query is a Wavefront QL query.
  • If an alert uses a PromQL query, the Backtesting option currently doesn’t work correctly.

How Wavefront Executes PromQL Queries

The following diagram shows how Wavefront handles a Wavefront QL (ts()) query and a PromQL query.

Image showing TS and PromQL execution paths, explained in text

The top row shows the ts() query execution:

  1. The user enters the query into the Query Editor.
  2. The Wavefront service processes the query and shows the results in the chart, uses the result to determine whether an alert should fire, etc.

The bottom row shows the PromQL query execution:

  1. The user enters the query into the Query Editor.
  2. The translation service translates the query into the corresponding ts() query.
  3. The translated query is automatically sent to the Wavefront service.
  4. The Wavefront service processes the query and shows the results in the chart, uses the result to determine whether an alert should fire, etc.