Skip to main content
Evaluates a prometheus query using data from a TimeSeries table.

Syntax

Arguments

  • db_name - The name of the database where a TimeSeries table is located.
  • time_series_table - The name of a TimeSeries table.
  • promql_query - A query written in PromQL syntax.
  • evaluation_time - The evaluation timestamp. To evaluate a query at the current time, use now()asevaluation_time`.

Returned value

The function can returns different columns depending on the result type of the query passed to parameter promql_query:

Supported PromQL Features

Selectors

Instant selectors, range selectors, label matchers (=, !=, =~, !~), offset modifiers, @ timestamp modifiers, and subqueries.

Functions

Note: histogram_quantile uses linear interpolation on classic histogram buckets (identified by the le label). Native histograms are not supported. The phi (quantile level) argument must be a constant scalar. Expressions that vary per step, such as histogram_quantile(time() / 1000, ...), are rejected with a NOT_IMPLEMENTED exception.

Operators

Arithmetic (+, -, *, /, %, ^, atan2) and comparison (==, !=, <, >, <=, >= with optional bool) binary operators, with on()/ignoring() and group_left()/group_right() modifiers. Logical set operators and, or, and unless, with on()/ignoring() modifiers. Unary operators + and -.

Aggregation Operators

sum, avg, min, max, count, stddev, stdvar, group, quantile, topk, bottomk, limitk — with optional by() or without() modifiers.

Not yet supported

  • Aggregation operator count_values
  • Range functions predict_linear, avg_over_time, min_over_time, max_over_time, sum_over_time, count_over_time, quantile_over_time, stddev_over_time, stdvar_over_time, present_over_time, absent_over_time, mad_over_time, first_over_time, ts_of_min_over_time, ts_of_max_over_time, ts_of_last_over_time, ts_of_first_over_time
  • Function absent

Example

Last modified on August 18, 2026