Skip to content

promql🔗

Objects🔗

Builders🔗

Functions🔗

NewExpr🔗

NewExpr creates a new Expr object.

func NewExpr() *Expr

NewNumberLiteralExpr🔗

NewNumberLiteralExpr creates a new NumberLiteralExpr object.

func NewNumberLiteralExpr() *NumberLiteralExpr

NewStringLiteralExpr🔗

NewStringLiteralExpr creates a new StringLiteralExpr object.

func NewStringLiteralExpr() *StringLiteralExpr

NewSubqueryExpr🔗

NewSubqueryExpr creates a new SubqueryExpr object.

func NewSubqueryExpr() *SubqueryExpr

NewAggregationExpr🔗

NewAggregationExpr creates a new AggregationExpr object.

func NewAggregationExpr() *AggregationExpr

NewVectorExpr🔗

NewVectorExpr creates a new VectorExpr object.

func NewVectorExpr() *VectorExpr

NewLabelSelector🔗

NewLabelSelector creates a new LabelSelector object.

func NewLabelSelector() *LabelSelector

NewBinaryExpr🔗

NewBinaryExpr creates a new BinaryExpr object.

func NewBinaryExpr() *BinaryExpr

NewUnaryExpr🔗

NewUnaryExpr creates a new UnaryExpr object.

func NewUnaryExpr() *UnaryExpr

NewFuncCallExpr🔗

NewFuncCallExpr creates a new FuncCallExpr object.

func NewFuncCallExpr() *FuncCallExpr

NewNumberLiteralExprOrStringLiteralExprOrSubqueryExprOrAggregationExprOrVectorExprOrBinaryExprOrUnaryExprOrFuncCallExpr🔗

NewNumberLiteralExprOrStringLiteralExprOrSubqueryExprOrAggregationExprOrVectorExprOrBinaryExprOrUnaryExprOrFuncCallExpr creates a new NumberLiteralExprOrStringLiteralExprOrSubqueryExprOrAggregationExprOrVectorExprOrBinaryExprOrUnaryExprOrFuncCallExpr object.

func NewNumberLiteralExprOrStringLiteralExprOrSubqueryExprOrAggregationExprOrVectorExprOrBinaryExprOrUnaryExprOrFuncCallExpr() *NumberLiteralExprOrStringLiteralExprOrSubqueryExprOrAggregationExprOrVectorExprOrBinaryExprOrUnaryExprOrFuncCallExpr

Sum🔗

Calculate sum over dimensions.

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

func Sum(vector cog.Builder[Expr]) *AggregationExprBuilder

Min🔗

Calculate minimum over dimensions.

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

func Min(vector cog.Builder[Expr]) *AggregationExprBuilder

Max🔗

Calculate maximum over dimensions.

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

func Max(vector cog.Builder[Expr]) *AggregationExprBuilder

Avg🔗

Calculate the average over dimensions.

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

func Avg(vector cog.Builder[Expr]) *AggregationExprBuilder

Group🔗

All values in the resulting vector are 1.

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

func Group(vector cog.Builder[Expr]) *AggregationExprBuilder

Stddev🔗

Calculate population standard deviation over dimensions.

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

func Stddev(vector cog.Builder[Expr]) *AggregationExprBuilder

Stdvar🔗

Calculate population standard variance over dimensions.

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

func Stdvar(vector cog.Builder[Expr]) *AggregationExprBuilder

Count🔗

Count number of elements in the vector.

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

func Count(vector cog.Builder[Expr]) *AggregationExprBuilder

Quantile🔗

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

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

func Quantile(vector cog.Builder[Expr]) *AggregationExprBuilder

CountValues🔗

Count number of elements with the same value.

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

func CountValues(label string, vector cog.Builder[Expr]) *AggregationExprBuilder

Bottomk🔗

Smallest k elements by sample value.

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

func Bottomk(k float64, vector cog.Builder[Expr]) *AggregationExprBuilder

Topk🔗

Largest k elements by sample value.

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

func Topk(k float64, vector cog.Builder[Expr]) *AggregationExprBuilder

Limitk🔗

Sample k elements.

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

func Limitk(k float64, vector cog.Builder[Expr]) *AggregationExprBuilder

LimitRatio🔗

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

func LimitRatio(k float64, vector cog.Builder[Expr]) *AggregationExprBuilder

Add🔗

Addition binary operator.

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

func Add(left cog.Builder[Expr], right cog.Builder[Expr]) *BinaryExprBuilder

Sub🔗

Subtraction binary operator.

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

func Sub(left cog.Builder[Expr], right cog.Builder[Expr]) *BinaryExprBuilder

Mul🔗

Multiplication binary operator.

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

func Mul(left cog.Builder[Expr], right cog.Builder[Expr]) *BinaryExprBuilder

Div🔗

Division binary operator.

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

func Div(left cog.Builder[Expr], right cog.Builder[Expr]) *BinaryExprBuilder

Mod🔗

Modulo binary operator.

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

func Mod(left cog.Builder[Expr], right cog.Builder[Expr]) *BinaryExprBuilder

Pow🔗

Power/exponentiation binary operator.

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

func Pow(left cog.Builder[Expr], right cog.Builder[Expr]) *BinaryExprBuilder

Eq🔗

"equal" comparison binary operator.

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

func Eq(left cog.Builder[Expr], right cog.Builder[Expr]) *BinaryExprBuilder

Neq🔗

"not-equal" comparison binary operator.

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

func Neq(left cog.Builder[Expr], right cog.Builder[Expr]) *BinaryExprBuilder

Gt🔗

"greater-than" comparison binary operator.

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

func Gt(left cog.Builder[Expr], right cog.Builder[Expr]) *BinaryExprBuilder

Lt🔗

"less-than" comparison binary operator.

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

func Lt(left cog.Builder[Expr], right cog.Builder[Expr]) *BinaryExprBuilder

Gte🔗

"greater-or-equal" comparison binary operator.

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

func Gte(left cog.Builder[Expr], right cog.Builder[Expr]) *BinaryExprBuilder

Lte🔗

"less-or-equal" comparison binary operator.

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

func Lte(left cog.Builder[Expr], right cog.Builder[Expr]) *BinaryExprBuilder

And🔗

"intersection" logical/set binary operator.

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

func And(left cog.Builder[Expr], right cog.Builder[Expr]) *BinaryExprBuilder

Or🔗

"union" logical/set binary operator.

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

func Or(left cog.Builder[Expr], right cog.Builder[Expr]) *BinaryExprBuilder

Unless🔗

"complement" logical/set binary operator.

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

func Unless(left cog.Builder[Expr], right cog.Builder[Expr]) *BinaryExprBuilder

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

func Atan2(left cog.Builder[Expr], right cog.Builder[Expr]) *BinaryExprBuilder

Abs🔗

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

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

func Abs(v cog.Builder[Expr]) *FuncCallExprBuilder

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

func Absent(v cog.Builder[Expr]) *FuncCallExprBuilder

AbsentOverTime🔗

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

func AbsentOverTime(v cog.Builder[Expr]) *FuncCallExprBuilder

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

func Ceil(v cog.Builder[Expr]) *FuncCallExprBuilder

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

func Changes(v cog.Builder[Expr]) *FuncCallExprBuilder

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

func Clamp(v cog.Builder[Expr], min float64, max float64) *FuncCallExprBuilder

ClampMax🔗

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

func ClampMax(v cog.Builder[Expr], max float64) *FuncCallExprBuilder

ClampMin🔗

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

func ClampMin(v cog.Builder[Expr], min float64) *FuncCallExprBuilder

DayOfMonth🔗

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

func DayOfMonth() *FuncCallExprBuilder

DayOfMonthFor🔗

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

func DayOfMonthFor(v cog.Builder[Expr]) *FuncCallExprBuilder

DayOfWeek🔗

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

func DayOfWeek() *FuncCallExprBuilder

DayOfWeekFor🔗

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

func DayOfWeekFor(v cog.Builder[Expr]) *FuncCallExprBuilder

DayOfYear🔗

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

func DayOfYear() *FuncCallExprBuilder

DayOfYearFor🔗

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

func DayOfYearFor(v cog.Builder[Expr]) *FuncCallExprBuilder

DaysInMonth🔗

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

func DaysInMonth() *FuncCallExprBuilder

DayInMonthFor🔗

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

func DayInMonthFor(v cog.Builder[Expr]) *FuncCallExprBuilder

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

func Delta(v cog.Builder[Expr]) *FuncCallExprBuilder

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

func Deriv(v cog.Builder[Expr]) *FuncCallExprBuilder

Exp🔗

Calculates the exponential function for all elements in vector

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

func Exp(v cog.Builder[Expr]) *FuncCallExprBuilder

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

func Floor(v cog.Builder[Expr]) *FuncCallExprBuilder

HistogramAvg🔗

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

func HistogramAvg(v cog.Builder[Expr]) *FuncCallExprBuilder

HistogramCount🔗

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

func HistogramCount(v cog.Builder[Expr]) *FuncCallExprBuilder

HistogramSum🔗

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

func HistogramSum(v cog.Builder[Expr]) *FuncCallExprBuilder

HistogramFraction🔗

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

func HistogramFraction(lower float64, upper float64, v cog.Builder[Expr]) *FuncCallExprBuilder

HistogramQuantile🔗

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

func HistogramQuantile(phi float64, v cog.Builder[Expr]) *FuncCallExprBuilder

HistogramStddev🔗

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

func HistogramStddev(v cog.Builder[Expr]) *FuncCallExprBuilder

HistogramStdvar🔗

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

func HistogramStdvar(v cog.Builder[Expr]) *FuncCallExprBuilder

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

func Hour() *FuncCallExprBuilder

HourFor🔗

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

func HourFor(v cog.Builder[Expr]) *FuncCallExprBuilder

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

func Idelta(v cog.Builder[Expr]) *FuncCallExprBuilder

Increase🔗

Calculates the increase in the time series in the range vector

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

func Increase(v cog.Builder[Expr]) *FuncCallExprBuilder

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

func Irate(v cog.Builder[Expr]) *FuncCallExprBuilder

LabelReplace🔗

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

func LabelReplace(v cog.Builder[Expr], dst_label string, replacement string, src_label string, regex string) *FuncCallExprBuilder

Ln🔗

Calculates the natural logarithm for all elements in v.

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

func Ln(v cog.Builder[Expr]) *FuncCallExprBuilder

Log2🔗

Calculates the binary logarithm for all elements in v.

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

func Log2(v cog.Builder[Expr]) *FuncCallExprBuilder

Log10🔗

Calculates the decimal logarithm for all elements in v.

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

func Log10(v cog.Builder[Expr]) *FuncCallExprBuilder

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

func Minute() *FuncCallExprBuilder

MinuteFor🔗

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

func MinuteFor(v cog.Builder[Expr]) *FuncCallExprBuilder

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

func Month() *FuncCallExprBuilder

MonthFor🔗

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

func MonthFor(v cog.Builder[Expr]) *FuncCallExprBuilder

PredictLinear🔗

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

func PredictLinear(v cog.Builder[Expr], t float64) *FuncCallExprBuilder

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

func Rate(v cog.Builder[Expr]) *FuncCallExprBuilder

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

func Resets(v cog.Builder[Expr]) *FuncCallExprBuilder

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

func Round(v cog.Builder[Expr]) *FuncCallExprBuilder

RoundTo🔗

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

func RoundTo(v cog.Builder[Expr], to_nearest float64) *FuncCallExprBuilder

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

func Scalar(v cog.Builder[Expr]) *FuncCallExprBuilder

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

func Sgn(v cog.Builder[Expr]) *FuncCallExprBuilder

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

func Sort(v cog.Builder[Expr]) *FuncCallExprBuilder

SortDesc🔗

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

func SortDesc(v cog.Builder[Expr]) *FuncCallExprBuilder

Sqrt🔗

Calculates the square root of all elements in v.

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

func Sqrt(v cog.Builder[Expr]) *FuncCallExprBuilder

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

func Time() *FuncCallExprBuilder

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

func Timestamp(v cog.Builder[Expr]) *FuncCallExprBuilder

Vect🔗

Returns the scalar s as a vector with no labels.

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

func Vect(s float64) *FuncCallExprBuilder

Year🔗

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

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

func Year() *FuncCallExprBuilder

YearFor🔗

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

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

func YearFor(v cog.Builder[Expr]) *FuncCallExprBuilder

AvgOverTime🔗

Calculates average value of all points in the specified interval.

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

func AvgOverTime(v cog.Builder[Expr]) *FuncCallExprBuilder

MinOverTime🔗

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

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

func MinOverTime(v cog.Builder[Expr]) *FuncCallExprBuilder

MaxOverTime🔗

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

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

func MaxOverTime(v cog.Builder[Expr]) *FuncCallExprBuilder

SumOverTime🔗

Calculates the sum of all values in the specified interval.

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

func SumOverTime(v cog.Builder[Expr]) *FuncCallExprBuilder

CountOverTime🔗

Calculates the count of all values in the specified interval.

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

func CountOverTime(v cog.Builder[Expr]) *FuncCallExprBuilder

QuantileOverTime🔗

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

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

func QuantileOverTime(phi float64, v cog.Builder[Expr]) *FuncCallExprBuilder

StddevOverTime🔗

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

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

func StddevOverTime(v cog.Builder[Expr]) *FuncCallExprBuilder

StdvarOverTime🔗

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

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

func StdvarOverTime(v cog.Builder[Expr]) *FuncCallExprBuilder

LastOverTime🔗

Returns the most recent point value in the specified interval.

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

func LastOverTime(v cog.Builder[Expr]) *FuncCallExprBuilder

PresentOverTime🔗

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

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

func PresentOverTime(v cog.Builder[Expr]) *FuncCallExprBuilder

Acos🔗

Calculates the arccosine of all elements in v

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

func Acos(v cog.Builder[Expr]) *FuncCallExprBuilder

Acosh🔗

Calculates the inverse hyperbolic cosine of all elements in v

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

func Acosh(v cog.Builder[Expr]) *FuncCallExprBuilder

Asin🔗

Calculates the arcsine of all elements in v

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

func Asin(v cog.Builder[Expr]) *FuncCallExprBuilder

Asinh🔗

Calculates the inverse hyperbolic sine of all elements in v

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

func Asinh(v cog.Builder[Expr]) *FuncCallExprBuilder

Atan🔗

Calculates the arctangent of all elements in v

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

func Atan(v cog.Builder[Expr]) *FuncCallExprBuilder

Atanh🔗

Calculates the inverse hyperbolic tangent of all elements in v

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

func Atanh(v cog.Builder[Expr]) *FuncCallExprBuilder

Cos🔗

Calculates the cosine of all elements in v

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

func Cos(v cog.Builder[Expr]) *FuncCallExprBuilder

Cosh🔗

Calculates the hyperbolic cosine of all elements in v

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

func Cosh(v cog.Builder[Expr]) *FuncCallExprBuilder

Sin🔗

Calculates the sine of all elements in v

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

func Sin(v cog.Builder[Expr]) *FuncCallExprBuilder

Sinh🔗

Calculates the hyperbolic sine of all elements in v

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

func Sinh(v cog.Builder[Expr]) *FuncCallExprBuilder

Tan🔗

Calculates the tangent of all elements in v

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

func Tan(v cog.Builder[Expr]) *FuncCallExprBuilder

Tanh🔗

Calculates the hyperbolic tangent of all elements in v

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

func Tanh(v cog.Builder[Expr]) *FuncCallExprBuilder

Deg🔗

Converts radians to degrees for all elements in v.

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

func Deg(v cog.Builder[Expr]) *FuncCallExprBuilder

Pi🔗

Returns pi.

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

func Pi() *FuncCallExprBuilder

Rad🔗

Converts degrees to radians for all elements in v.

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

func Rad(v cog.Builder[Expr]) *FuncCallExprBuilder

N🔗

Shortcut to turn a number into a NumberLiteral expression.

func N(value float64) *NumberLiteralBuilder

S🔗

Shortcut to turn a string into a StringLiteral expression.

func S(value string) *StringLiteralBuilder

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

func Subquery(expression cog.Builder[Expr]) *SubqueryExprBuilder

Neg🔗

Negation unary operator.

func Neg(expr cog.Builder[Expr]) *UnaryExprBuilder

Id🔗

Identity unary operator.

func Id(expr cog.Builder[Expr]) *UnaryExprBuilder

Vector🔗

Returns the scalar s as a vector with no labels.

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

func Vector(s string) *VectorExprBuilder