Skip to content

promql🔗

Objects🔗

Builders🔗

Functions🔗

n🔗

Shortcut to turn a number into a NumberLiteralExpr expression.

def n(value: float) -> NumberLiteralExpr

s🔗

Shortcut to turn a string into a StringLiteralExpr expression.

def s(value: str) -> StringLiteralExpr

subquery🔗

Creates a subquery.

Subquery allows you to run an instant query for a given range and resolution. The result of a subquery is a range vector.

See https://prometheus.io/docs/prometheus/latest/querying/basics/#subquery

def subquery(expression: cogbuilder.Builder[promql.Expr]) -> SubqueryExpr

sum🔗

Calculate sum over dimensions.

See https://prometheus.io/docs/prometheus/latest/querying/operators/#aggregation-operators

def sum(vector: cogbuilder.Builder[promql.Expr]) -> AggregationExpr

min🔗

Calculate minimum over dimensions.

See https://prometheus.io/docs/prometheus/latest/querying/operators/#aggregation-operators

def min(vector: cogbuilder.Builder[promql.Expr]) -> AggregationExpr

max🔗

Calculate maximum over dimensions.

See https://prometheus.io/docs/prometheus/latest/querying/operators/#aggregation-operators

def max(vector: cogbuilder.Builder[promql.Expr]) -> AggregationExpr

avg🔗

Calculate the average over dimensions.

See https://prometheus.io/docs/prometheus/latest/querying/operators/#aggregation-operators

def avg(vector: cogbuilder.Builder[promql.Expr]) -> AggregationExpr

group🔗

All values in the resulting vector are 1.

See https://prometheus.io/docs/prometheus/latest/querying/operators/#aggregation-operators

def group(vector: cogbuilder.Builder[promql.Expr]) -> AggregationExpr

stddev🔗

Calculate population standard deviation over dimensions.

See https://prometheus.io/docs/prometheus/latest/querying/operators/#aggregation-operators

def stddev(vector: cogbuilder.Builder[promql.Expr]) -> AggregationExpr

stdvar🔗

Calculate population standard variance over dimensions.

See https://prometheus.io/docs/prometheus/latest/querying/operators/#aggregation-operators

def stdvar(vector: cogbuilder.Builder[promql.Expr]) -> AggregationExpr

count🔗

Count number of elements in the vector.

See https://prometheus.io/docs/prometheus/latest/querying/operators/#aggregation-operators

def count(vector: cogbuilder.Builder[promql.Expr]) -> AggregationExpr

quantile🔗

Calculate φ-quantile (0 ≤ φ ≤ 1) over dimensions.

See https://prometheus.io/docs/prometheus/latest/querying/operators/#aggregation-operators

def quantile(vector: cogbuilder.Builder[promql.Expr]) -> AggregationExpr

count_values🔗

Count number of elements with the same value.

See https://prometheus.io/docs/prometheus/latest/querying/operators/#aggregation-operators

def count_values(label: str, vector: cogbuilder.Builder[promql.Expr]) -> AggregationExpr

bottomk🔗

Smallest k elements by sample value.

See https://prometheus.io/docs/prometheus/latest/querying/operators/#aggregation-operators

def bottomk(k: float, vector: cogbuilder.Builder[promql.Expr]) -> AggregationExpr

topk🔗

Largest k elements by sample value.

See https://prometheus.io/docs/prometheus/latest/querying/operators/#aggregation-operators

def topk(k: float, vector: cogbuilder.Builder[promql.Expr]) -> AggregationExpr

limitk🔗

Sample k elements.

See https://prometheus.io/docs/prometheus/latest/querying/operators/#aggregation-operators

def limitk(k: float, vector: cogbuilder.Builder[promql.Expr]) -> AggregationExpr

limit_ratio🔗

Sample elements with approximately r ratio if r > 0, and the complement of such samples if r = -(1.0 - r).

See https://prometheus.io/docs/prometheus/latest/querying/operators/#aggregation-operators

def limit_ratio(k: float, vector: cogbuilder.Builder[promql.Expr]) -> AggregationExpr

vector🔗

Returns the scalar s as a vector with no labels.

See https://prometheus.io/docs/prometheus/latest/querying/functions/#vector

def vector(s: str) -> VectorExpr

add🔗

Addition binary operator.

See https://prometheus.io/docs/prometheus/latest/querying/operators/#arithmetic-binary-operators

def add(left: cogbuilder.Builder[promql.Expr], right: cogbuilder.Builder[promql.Expr]) -> BinaryExpr

sub🔗

Subtraction binary operator.

See https://prometheus.io/docs/prometheus/latest/querying/operators/#arithmetic-binary-operators

def sub(left: cogbuilder.Builder[promql.Expr], right: cogbuilder.Builder[promql.Expr]) -> BinaryExpr

mul🔗

Multiplication binary operator.

See https://prometheus.io/docs/prometheus/latest/querying/operators/#arithmetic-binary-operators

def mul(left: cogbuilder.Builder[promql.Expr], right: cogbuilder.Builder[promql.Expr]) -> BinaryExpr

div🔗

Division binary operator.

See https://prometheus.io/docs/prometheus/latest/querying/operators/#arithmetic-binary-operators

def div(left: cogbuilder.Builder[promql.Expr], right: cogbuilder.Builder[promql.Expr]) -> BinaryExpr

mod🔗

Modulo binary operator.

See https://prometheus.io/docs/prometheus/latest/querying/operators/#arithmetic-binary-operators

def mod(left: cogbuilder.Builder[promql.Expr], right: cogbuilder.Builder[promql.Expr]) -> BinaryExpr

pow🔗

Power/exponentiation binary operator.

See https://prometheus.io/docs/prometheus/latest/querying/operators/#arithmetic-binary-operators

def pow(left: cogbuilder.Builder[promql.Expr], right: cogbuilder.Builder[promql.Expr]) -> BinaryExpr

eq🔗

"equal" comparison binary operator.

See https://prometheus.io/docs/prometheus/latest/querying/operators/#comparison-binary-operators

def eq(left: cogbuilder.Builder[promql.Expr], right: cogbuilder.Builder[promql.Expr]) -> BinaryExpr

neq🔗

"not-equal" comparison binary operator.

See https://prometheus.io/docs/prometheus/latest/querying/operators/#comparison-binary-operators

def neq(left: cogbuilder.Builder[promql.Expr], right: cogbuilder.Builder[promql.Expr]) -> BinaryExpr

gt🔗

"greater-than" comparison binary operator.

See https://prometheus.io/docs/prometheus/latest/querying/operators/#comparison-binary-operators

def gt(left: cogbuilder.Builder[promql.Expr], right: cogbuilder.Builder[promql.Expr]) -> BinaryExpr

lt🔗

"less-than" comparison binary operator.

See https://prometheus.io/docs/prometheus/latest/querying/operators/#comparison-binary-operators

def lt(left: cogbuilder.Builder[promql.Expr], right: cogbuilder.Builder[promql.Expr]) -> BinaryExpr

gte🔗

"greater-or-equal" comparison binary operator.

See https://prometheus.io/docs/prometheus/latest/querying/operators/#comparison-binary-operators

def gte(left: cogbuilder.Builder[promql.Expr], right: cogbuilder.Builder[promql.Expr]) -> BinaryExpr

lte🔗

"less-or-equal" comparison binary operator.

See https://prometheus.io/docs/prometheus/latest/querying/operators/#comparison-binary-operators

def lte(left: cogbuilder.Builder[promql.Expr], right: cogbuilder.Builder[promql.Expr]) -> BinaryExpr

and_val🔗

"intersection" logical/set binary operator.

See https://prometheus.io/docs/prometheus/latest/querying/operators/#logical-set-binary-operators

def and_val(left: cogbuilder.Builder[promql.Expr], right: cogbuilder.Builder[promql.Expr]) -> BinaryExpr

or_val🔗

"union" logical/set binary operator.

See https://prometheus.io/docs/prometheus/latest/querying/operators/#logical-set-binary-operators

def or_val(left: cogbuilder.Builder[promql.Expr], right: cogbuilder.Builder[promql.Expr]) -> BinaryExpr

unless🔗

"complement" logical/set binary operator.

See https://prometheus.io/docs/prometheus/latest/querying/operators/#logical-set-binary-operators

def unless(left: cogbuilder.Builder[promql.Expr], right: cogbuilder.Builder[promql.Expr]) -> BinaryExpr

atan2🔗

Arc tangent binary operator. Works in radians.

Trigonometric operators allow trigonometric functions to be executed on two vectors using vector matching, which isn't available with normal functions.

They act in the same manner as arithmetic operators.

See https://prometheus.io/docs/prometheus/latest/querying/operators/#trigonometric-binary-operators

def atan2(left: cogbuilder.Builder[promql.Expr], right: cogbuilder.Builder[promql.Expr]) -> BinaryExpr

neg🔗

Negation unary operator.

def neg(expr: cogbuilder.Builder[promql.Expr]) -> UnaryExpr

id🔗

Identity unary operator.

def id(expr: cogbuilder.Builder[promql.Expr]) -> UnaryExpr

abs🔗

Returns the input vector with all sample values converted to their absolute value.

See https://prometheus.io/docs/prometheus/latest/querying/functions/#abs

def abs(v: cogbuilder.Builder[promql.Expr]) -> FuncCallExpr

absent🔗

Returns an empty vector if the vector passed to it has any elements (floats or native histograms) and a 1-element vector with the value 1 if the vector passed to it has no elements.

This is useful for alerting on when no time series exist for a given metric name and label combination.

See https://prometheus.io/docs/prometheus/latest/querying/functions/#absent

def absent(v: cogbuilder.Builder[promql.Expr]) -> FuncCallExpr

absent_over_time🔗

Returns an empty vector if the range vector passed to it has any elements (floats or native histograms) and a 1-element vector with the value 1 if the range vector passed to it has no elements.

This is useful for alerting on when no time series exist for a given metric name and label combination for a certain amount of time.

See https://prometheus.io/docs/prometheus/latest/querying/functions/#absent_over_time

def absent_over_time(v: cogbuilder.Builder[promql.Expr]) -> FuncCallExpr

ceil🔗

Rounds the sample values of all elements in v up to the nearest integer value greater than or equal to v.

See https://prometheus.io/docs/prometheus/latest/querying/functions/#ceil

def ceil(v: cogbuilder.Builder[promql.Expr]) -> FuncCallExpr

changes🔗

For each input time series, returns the number of times its value has changed within the provided time range as an instant vector.

See https://prometheus.io/docs/prometheus/latest/querying/functions/#changes

def changes(v: cogbuilder.Builder[promql.Expr]) -> FuncCallExpr

clamp🔗

Clamps the sample values of all elements in v to have a lower limit of min and an upper limit of max.

See https://prometheus.io/docs/prometheus/latest/querying/functions/#clamp

def clamp(v: cogbuilder.Builder[promql.Expr], min: float, max: float) -> FuncCallExpr

clamp_max🔗

Clamps the sample values of all elements in v to have an upper limit of max.

See https://prometheus.io/docs/prometheus/latest/querying/functions/#clamp_max

def clamp_max(v: cogbuilder.Builder[promql.Expr], max: float) -> FuncCallExpr

clamp_min🔗

Clamps the sample values of all elements in v to have an lower limit of min.

See https://prometheus.io/docs/prometheus/latest/querying/functions/#clamp_min

def clamp_min(v: cogbuilder.Builder[promql.Expr], min: float) -> FuncCallExpr

day_of_month🔗

Returns the day of the month in UTC. Returned values are from 1 to 31.

See https://prometheus.io/docs/prometheus/latest/querying/functions/#day_of_month

def day_of_month() -> FuncCallExpr

day_of_month_for🔗

Returns the day of the month for each of the given times in UTC. Returned values are from 1 to 31.

See https://prometheus.io/docs/prometheus/latest/querying/functions/#day_of_month

def day_of_month_for(v: cogbuilder.Builder[promql.Expr]) -> FuncCallExpr

day_of_week🔗

Returns the day of the week in UTC. Returned values are from 0 to 6, where 0 means Sunday etc.

See https://prometheus.io/docs/prometheus/latest/querying/functions/#day_of_week

def day_of_week() -> FuncCallExpr

day_of_week_for🔗

Returns the day of the week for each of the given times in UTC. Returned values are from 0 to 6, where 0 means Sunday etc.

See https://prometheus.io/docs/prometheus/latest/querying/functions/#day_of_week

def day_of_week_for(v: cogbuilder.Builder[promql.Expr]) -> FuncCallExpr

day_of_year🔗

Returns the day of the year in UTC. Returned values are from 1 to 365 for non-leap years, and 1 to 366 in leap years.

See https://prometheus.io/docs/prometheus/latest/querying/functions/#day_of_year

def day_of_year() -> FuncCallExpr

day_of_year_for🔗

Returns the day of the year for each of the given times in UTC. Returned values are from 1 to 365 for non-leap years, and 1 to 366 in leap years.

See https://prometheus.io/docs/prometheus/latest/querying/functions/#day_of_year

def day_of_year_for(v: cogbuilder.Builder[promql.Expr]) -> FuncCallExpr

days_in_month🔗

Returns the number of days in the month. Returned values are from 28 to 31.

See https://prometheus.io/docs/prometheus/latest/querying/functions/#days_in_month

def days_in_month() -> FuncCallExpr

day_in_month_for🔗

Returns the number of days in the month for each of the given times in UTC. Returned values are from 28 to 31.

See https://prometheus.io/docs/prometheus/latest/querying/functions/#days_in_month

def day_in_month_for(v: cogbuilder.Builder[promql.Expr]) -> FuncCallExpr

delta🔗

Calculates the difference between the first and last value of each time series element in a range vector, returning an instant vector with the given deltas and equivalent labels.

The delta is extrapolated to cover the full time range as specified in the range vector selector, so that it is possible to get a non-integer result even if the sample values are all integers.

See https://prometheus.io/docs/prometheus/latest/querying/functions/#delta

def delta(v: cogbuilder.Builder[promql.Expr]) -> FuncCallExpr

deriv🔗

Calculates the per-second derivative of the time series in a range vector using simple linear regression.

The range vector must have at least two samples in order to perform the calculation. When +Inf or -Inf are found in the range vector, the slope and offset value calculated will be NaN.

deriv should only be used with gauges.

See https://prometheus.io/docs/prometheus/latest/querying/functions/#deriv

def deriv(v: cogbuilder.Builder[promql.Expr]) -> FuncCallExpr

exp🔗

Calculates the exponential function for all elements in vector

See https://prometheus.io/docs/prometheus/latest/querying/functions/#exp

def exp(v: cogbuilder.Builder[promql.Expr]) -> FuncCallExpr

floor🔗

Rounds the sample values of all elements in v down to the nearest integer value smaller than or equal to v.

See https://prometheus.io/docs/prometheus/latest/querying/functions/#floor

def floor(v: cogbuilder.Builder[promql.Expr]) -> FuncCallExpr

histogram_avg🔗

Returns the arithmetic average of observed values stored in a native histogram. Samples that are not native histograms are ignored and do not show up in the returned vector.

Note: This function only acts on native histograms.

See https://prometheus.io/docs/prometheus/latest/querying/functions/#histogram_avg

def histogram_avg(v: cogbuilder.Builder[promql.Expr]) -> FuncCallExpr

histogram_count🔗

Returns the count of observations stored in a native histogram. Samples that are not native histograms are ignored and do not show up in the returned vector.

Note: This function only acts on native histograms.

See https://prometheus.io/docs/prometheus/latest/querying/functions/#histogram_count-and-histogram_sum

def histogram_count(v: cogbuilder.Builder[promql.Expr]) -> FuncCallExpr

histogram_sum🔗

Returns the sum of observations stored in a native histogram.

Note: This function only acts on native histograms.

See https://prometheus.io/docs/prometheus/latest/querying/functions/#histogram_count-and-histogram_sum

def histogram_sum(v: cogbuilder.Builder[promql.Expr]) -> FuncCallExpr

histogram_fraction🔗

Returns the estimated fraction of observations between the provided lower and upper values. Samples that are not native histograms are ignored and do not show up in the returned vector.

Note: This function only acts on native histograms.

See https://prometheus.io/docs/prometheus/latest/querying/functions/#histogram_fraction

def histogram_fraction(lower: float, upper: float, v: cogbuilder.Builder[promql.Expr]) -> FuncCallExpr

histogram_quantile🔗

Calculates the φ-quantile (0 ≤ φ ≤ 1) from a classic histogram or from a native histogram.

See https://prometheus.io/docs/prometheus/latest/querying/functions/#histogram_quantile

def histogram_quantile(phi: float, v: cogbuilder.Builder[promql.Expr]) -> FuncCallExpr

histogram_stddev🔗

Returns the estimated standard deviation of observations in a native histogram, based on the geometric mean of the buckets where the observations lie.

Samples that are not native histograms are ignored and do not show up in the returned vector.

Note: This function only acts on native histograms.

See https://prometheus.io/docs/prometheus/latest/querying/functions/#histogram_stddev

def histogram_stddev(v: cogbuilder.Builder[promql.Expr]) -> FuncCallExpr

histogram_stdvar🔗

Returns the estimated standard variance of observations in a native histogram.

Samples that are not native histograms are ignored and do not show up in the returned vector.

Note: This function only acts on native histograms.

See https://prometheus.io/docs/prometheus/latest/querying/functions/#histogram_stdvar

def histogram_stdvar(v: cogbuilder.Builder[promql.Expr]) -> FuncCallExpr

hour🔗

Returns the hour of the day for each of the given times in UTC. Returned values are from 0 to 23.

See https://prometheus.io/docs/prometheus/latest/querying/functions/#hour

def hour() -> FuncCallExpr

hour_for🔗

Returns the hour of the day for each of the given times in UTC. Returned values are from 0 to 23.

See https://prometheus.io/docs/prometheus/latest/querying/functions/#hour

def hour_for(v: cogbuilder.Builder[promql.Expr]) -> FuncCallExpr

idelta🔗

Calculates the difference between the last two samples in the range vector v, returning an instant vector with the given deltas and equivalent labels.

idelta should only be used with gauges.

See https://prometheus.io/docs/prometheus/latest/querying/functions/#idelta

def idelta(v: cogbuilder.Builder[promql.Expr]) -> FuncCallExpr

increase🔗

Calculates the increase in the time series in the range vector

See https://prometheus.io/docs/prometheus/latest/querying/functions/#increase

def increase(v: cogbuilder.Builder[promql.Expr]) -> FuncCallExpr

irate🔗

Calculates the per-second instant rate of increase of the time series in the range vector. This is based on the last two data points.

irate should only be used when graphing volatile, fast-moving counters. Use rate for alerts and slow-moving counters, as brief changes in the rate can reset the FOR clause and graphs consisting entirely of rare spikes are hard to read.

See https://prometheus.io/docs/prometheus/latest/querying/functions/#irate

def irate(v: cogbuilder.Builder[promql.Expr]) -> FuncCallExpr

label_replace🔗

matches the regular expression regex against the value of the label src_label. If it matches, the value of the label dst_label in the returned timeseries will be the expansion of replacement, together with the original labels in the input. Capturing groups in the regular expression can be referenced with $1, $2, etc. Named capturing groups in the regular expression can be referenced with $name (where name is the capturing group name). If the regular expression doesn't match then the timeseries is returned unchanged.

label_replace acts on float and histogram samples in the same way.

See https://prometheus.io/docs/prometheus/latest/querying/functions/#label_replace

def label_replace(v: cogbuilder.Builder[promql.Expr], dst_label: str, replacement: str, src_label: str, regex: str) -> FuncCallExpr

ln🔗

Calculates the natural logarithm for all elements in v.

See https://prometheus.io/docs/prometheus/latest/querying/functions/#ln

def ln(v: cogbuilder.Builder[promql.Expr]) -> FuncCallExpr

log2🔗

Calculates the binary logarithm for all elements in v.

See https://prometheus.io/docs/prometheus/latest/querying/functions/#log2

def log2(v: cogbuilder.Builder[promql.Expr]) -> FuncCallExpr

log10🔗

Calculates the decimal logarithm for all elements in v.

See https://prometheus.io/docs/prometheus/latest/querying/functions/#log10

def log10(v: cogbuilder.Builder[promql.Expr]) -> FuncCallExpr

minute🔗

Returns the minute of the hour for each of the given times in UTC. Returned values are from 0 to 59.

See https://prometheus.io/docs/prometheus/latest/querying/functions/#minute

def minute() -> FuncCallExpr

minute_for🔗

Returns the minute of the hour for each of the given times in UTC. Returned values are from 0 to 59.

See https://prometheus.io/docs/prometheus/latest/querying/functions/#minute

def minute_for(v: cogbuilder.Builder[promql.Expr]) -> FuncCallExpr

month🔗

Returns the month of the year for each of the given times in UTC. Returned values are from 1 to 12, where 1 means January etc.

See https://prometheus.io/docs/prometheus/latest/querying/functions/#month

def month() -> FuncCallExpr

month_for🔗

Returns the month of the year for each of the given times in UTC. Returned values are from 1 to 12, where 1 means January etc.

See https://prometheus.io/docs/prometheus/latest/querying/functions/#month

def month_for(v: cogbuilder.Builder[promql.Expr]) -> FuncCallExpr

predict_linear🔗

Predicts the value of time series t seconds from now, based on the range vector v, using simple linear regression. The range vector must have at least two samples in order to perform the calculation.

predict_linear should only be used with gauges.

See https://prometheus.io/docs/prometheus/latest/querying/functions/#predict_linear

def predict_linear(v: cogbuilder.Builder[promql.Expr], t: float) -> FuncCallExpr

rate🔗

Calculates the per-second average rate of increase of the time series in the range vector.

See https://prometheus.io/docs/prometheus/latest/querying/functions/#rate

def rate(v: cogbuilder.Builder[promql.Expr]) -> FuncCallExpr

resets🔗

For each input time series, resets(v range-vector) returns the number of counter resets within the provided time range as an instant vector. Any decrease in the value between two consecutive float samples is interpreted as a counter reset. A reset in a native histogram is detected in a more complex way: Any decrease in any bucket, including the zero bucket, or in the count of observation constitutes a counter reset, but also the disappearance of any previously populated bucket, an increase in bucket resolution, or a decrease of the zero-bucket width.

resets should only be used with counters and counter-like native histograms.

If the range vector contains a mix of float and histogram samples for the same series, counter resets are detected separately and their numbers added up. The change from a float to a histogram sample is not considered a counter reset. Each float sample is compared to the next float sample, and each histogram is compared to the next histogram.

See https://prometheus.io/docs/prometheus/latest/querying/functions/#resets

def resets(v: cogbuilder.Builder[promql.Expr]) -> FuncCallExpr

round🔗

Rounds the sample values of all elements in v to the nearest integer. Ties are resolved by rounding up.

See https://prometheus.io/docs/prometheus/latest/querying/functions/#round

def round(v: cogbuilder.Builder[promql.Expr]) -> FuncCallExpr

round_to🔗

Rounds the sample values of all elements in v to the nearest integer. Ties are resolved by rounding up.

The to_nearest argument allows specifying the nearest multiple to which the sample values should be rounded. This multiple may also be a fraction.

See https://prometheus.io/docs/prometheus/latest/querying/functions/#round

def round_to(v: cogbuilder.Builder[promql.Expr], to_nearest: float) -> FuncCallExpr

scalar🔗

Given a single-element input vector, scalar() returns the sample value of that single element as a scalar.

If the input vector does not have exactly one element, scalar will return NaN.

See https://prometheus.io/docs/prometheus/latest/querying/functions/#scalar

def scalar(v: cogbuilder.Builder[promql.Expr]) -> FuncCallExpr

sgn🔗

Returns a vector with all sample values converted to their sign, defined as this: 1 if v is positive, -1 if v is negative and 0 if v is equal to zero.

See https://prometheus.io/docs/prometheus/latest/querying/functions/#sgn

def sgn(v: cogbuilder.Builder[promql.Expr]) -> FuncCallExpr

sort🔗

Returns vector elements sorted by their sample values, in ascending order. Native histograms are sorted by their sum of observations.

Note that sort only affects the results of instant queries, as range query results always have a fixed output ordering.

See https://prometheus.io/docs/prometheus/latest/querying/functions/#sort

def sort(v: cogbuilder.Builder[promql.Expr]) -> FuncCallExpr

sort_desc🔗

Same as sort(), but sorts in descending order.

Like sort, sort_desc only affects the results of instant queries, as range query results always have a fixed output ordering.

See https://prometheus.io/docs/prometheus/latest/querying/functions/#sort_desc

def sort_desc(v: cogbuilder.Builder[promql.Expr]) -> FuncCallExpr

sqrt🔗

Calculates the square root of all elements in v.

See https://prometheus.io/docs/prometheus/latest/querying/functions/#sqrt

def sqrt(v: cogbuilder.Builder[promql.Expr]) -> FuncCallExpr

time🔗

Returns the number of seconds since January 1, 1970 UTC. Note that this does not actually return the current time, but the time at which the expression is to be evaluated.

See https://prometheus.io/docs/prometheus/latest/querying/functions/#time

def time() -> FuncCallExpr

timestamp🔗

Returns the timestamp of each of the samples of the given vector as the number of seconds since January 1, 1970 UTC. It also works with histogram samples.

See https://prometheus.io/docs/prometheus/latest/querying/functions/#timestamp

def timestamp(v: cogbuilder.Builder[promql.Expr]) -> FuncCallExpr

vect🔗

Returns the scalar s as a vector with no labels.

See https://prometheus.io/docs/prometheus/latest/querying/functions/#vector

def vect(s: float) -> FuncCallExpr

year🔗

Returns the year for each of the given times in UTC.

See https://prometheus.io/docs/prometheus/latest/querying/functions/#year

def year() -> FuncCallExpr

year_for🔗

Returns the year for each of the given times in UTC.

See https://prometheus.io/docs/prometheus/latest/querying/functions/#year

def year_for(v: cogbuilder.Builder[promql.Expr]) -> FuncCallExpr

avg_over_time🔗

Calculates average value of all points in the specified interval.

See https://prometheus.io/docs/prometheus/latest/querying/functions/#aggregation_over_time

def avg_over_time(v: cogbuilder.Builder[promql.Expr]) -> FuncCallExpr

min_over_time🔗

Calculates the minimum value of all points in the specified interval.

See https://prometheus.io/docs/prometheus/latest/querying/functions/#aggregation_over_time

def min_over_time(v: cogbuilder.Builder[promql.Expr]) -> FuncCallExpr

max_over_time🔗

Calculates the maximum value of all points in the specified interval.

See https://prometheus.io/docs/prometheus/latest/querying/functions/#aggregation_over_time

def max_over_time(v: cogbuilder.Builder[promql.Expr]) -> FuncCallExpr

sum_over_time🔗

Calculates the sum of all values in the specified interval.

See https://prometheus.io/docs/prometheus/latest/querying/functions/#aggregation_over_time

def sum_over_time(v: cogbuilder.Builder[promql.Expr]) -> FuncCallExpr

count_over_time🔗

Calculates the count of all values in the specified interval.

See https://prometheus.io/docs/prometheus/latest/querying/functions/#aggregation_over_time

def count_over_time(v: cogbuilder.Builder[promql.Expr]) -> FuncCallExpr

quantile_over_time🔗

Calculates the φ-quantile (0 ≤ φ ≤ 1) of the values in the specified interval.

See https://prometheus.io/docs/prometheus/latest/querying/functions/#aggregation_over_time

def quantile_over_time(phi: float, v: cogbuilder.Builder[promql.Expr]) -> FuncCallExpr

stddev_over_time🔗

Calculates the population standard deviation of the values in the specified interval.

See https://prometheus.io/docs/prometheus/latest/querying/functions/#aggregation_over_time

def stddev_over_time(v: cogbuilder.Builder[promql.Expr]) -> FuncCallExpr

stdvar_over_time🔗

Calculates the population standard variance of the values in the specified interval.

See https://prometheus.io/docs/prometheus/latest/querying/functions/#aggregation_over_time

def stdvar_over_time(v: cogbuilder.Builder[promql.Expr]) -> FuncCallExpr

last_over_time🔗

Returns the most recent point value in the specified interval.

See https://prometheus.io/docs/prometheus/latest/querying/functions/#aggregation_over_time

def last_over_time(v: cogbuilder.Builder[promql.Expr]) -> FuncCallExpr

present_over_time🔗

Returns the value 1 for any series in the specified interval.

See https://prometheus.io/docs/prometheus/latest/querying/functions/#aggregation_over_time

def present_over_time(v: cogbuilder.Builder[promql.Expr]) -> FuncCallExpr

acos🔗

Calculates the arccosine of all elements in v

See https://prometheus.io/docs/prometheus/latest/querying/functions/#trigonometric-functions

def acos(v: cogbuilder.Builder[promql.Expr]) -> FuncCallExpr

acosh🔗

Calculates the inverse hyperbolic cosine of all elements in v

See https://prometheus.io/docs/prometheus/latest/querying/functions/#trigonometric-functions

def acosh(v: cogbuilder.Builder[promql.Expr]) -> FuncCallExpr

asin🔗

Calculates the arcsine of all elements in v

See https://prometheus.io/docs/prometheus/latest/querying/functions/#trigonometric-functions

def asin(v: cogbuilder.Builder[promql.Expr]) -> FuncCallExpr

asinh🔗

Calculates the inverse hyperbolic sine of all elements in v

See https://prometheus.io/docs/prometheus/latest/querying/functions/#trigonometric-functions

def asinh(v: cogbuilder.Builder[promql.Expr]) -> FuncCallExpr

atan🔗

Calculates the arctangent of all elements in v

See https://prometheus.io/docs/prometheus/latest/querying/functions/#trigonometric-functions

def atan(v: cogbuilder.Builder[promql.Expr]) -> FuncCallExpr

atanh🔗

Calculates the inverse hyperbolic tangent of all elements in v

See https://prometheus.io/docs/prometheus/latest/querying/functions/#trigonometric-functions

def atanh(v: cogbuilder.Builder[promql.Expr]) -> FuncCallExpr

cos🔗

Calculates the cosine of all elements in v

See https://prometheus.io/docs/prometheus/latest/querying/functions/#trigonometric-functions

def cos(v: cogbuilder.Builder[promql.Expr]) -> FuncCallExpr

cosh🔗

Calculates the hyperbolic cosine of all elements in v

See https://prometheus.io/docs/prometheus/latest/querying/functions/#trigonometric-functions

def cosh(v: cogbuilder.Builder[promql.Expr]) -> FuncCallExpr

sin🔗

Calculates the sine of all elements in v

See https://prometheus.io/docs/prometheus/latest/querying/functions/#trigonometric-functions

def sin(v: cogbuilder.Builder[promql.Expr]) -> FuncCallExpr

sinh🔗

Calculates the hyperbolic sine of all elements in v

See https://prometheus.io/docs/prometheus/latest/querying/functions/#trigonometric-functions

def sinh(v: cogbuilder.Builder[promql.Expr]) -> FuncCallExpr

tan🔗

Calculates the tangent of all elements in v

See https://prometheus.io/docs/prometheus/latest/querying/functions/#trigonometric-functions

def tan(v: cogbuilder.Builder[promql.Expr]) -> FuncCallExpr

tanh🔗

Calculates the hyperbolic tangent of all elements in v

See https://prometheus.io/docs/prometheus/latest/querying/functions/#trigonometric-functions

def tanh(v: cogbuilder.Builder[promql.Expr]) -> FuncCallExpr

deg🔗

Converts radians to degrees for all elements in v.

See https://prometheus.io/docs/prometheus/latest/querying/functions/#trigonometric-functions

def deg(v: cogbuilder.Builder[promql.Expr]) -> FuncCallExpr

pi🔗

Returns pi.

See https://prometheus.io/docs/prometheus/latest/querying/functions/#trigonometric-functions

def pi() -> FuncCallExpr

rad🔗

Converts degrees to radians for all elements in v.

See https://prometheus.io/docs/prometheus/latest/querying/functions/#trigonometric-functions

def rad(v: cogbuilder.Builder[promql.Expr]) -> FuncCallExpr