Commit dc7616e5 by Alexander Zobnin

ace: prometheus functions docs

parent f7ec8e0d
......@@ -93,232 +93,232 @@ var prometheusFunctions = [
{
name: 'abs()', value: 'abs',
def: 'abs(v instant-vector)',
docText: 'returns the input vector with all sample values converted to their absolute value.'
docText: 'Returns the input vector with all sample values converted to their absolute value.'
},
{
name: 'absent()', value: 'absent',
def: 'absent(v instant-vector)',
docText: 'returns an empty vector if the vector passed to it has any elements 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.'
docText: 'Returns an empty vector if the vector passed to it has any elements 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.'
},
{
name: 'ceil()', value: 'ceil',
def: 'ceil(v instant-vector)',
docText: 'rounds the sample values of all elements in `v` up to the nearest integer.'
docText: 'Rounds the sample values of all elements in `v` up to the nearest integer.'
},
{
name: 'changes()', value: 'changes',
def: 'changes()',
docText: ''
def: 'changes(v range-vector)',
docText: 'For each input time series, `changes(v range-vector)` returns the number of times its value has changed within the provided time range as an instant vector.'
},
{
name: 'clamp_max()', value: 'clamp_max',
def: 'clamp_max()',
docText: ''
def: 'clamp_max(v instant-vector, max scalar)',
docText: 'Clamps the sample values of all elements in `v` to have an upper limit of `max`.'
},
{
name: 'clamp_min()', value: 'clamp_min',
def: 'clamp_min()',
docText: ''
def: 'clamp_min(v instant-vector, min scalar)',
docText: 'Clamps the sample values of all elements in `v` to have a lower limit of `min`.'
},
{
name: 'count_scalar()', value: 'count_scalar',
def: 'count_scalar()',
docText: ''
def: 'count_scalar(v instant-vector)',
docText: 'Returns the number of elements in a time series vector as a scalar. This is in contrast to the `count()` aggregation operator, which always returns a vector (an empty one if the input vector is empty) and allows grouping by labels via a `by` clause.'
},
{
name: 'day_of_month()', value: 'day_of_month',
def: 'day_of_month()',
docText: ''
def: 'day_of_month(v=vector(time()) instant-vector)',
docText: 'Returns the day of the month for each of the given times in UTC. Returned values are from 1 to 31.'
},
{
name: 'day_of_week()', value: 'day_of_week',
def: 'day_of_week()',
docText: ''
def: 'day_of_week(v=vector(time()) instant-vector)',
docText: '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.'
},
{
name: 'days_in_month()', value: 'days_in_month',
def: 'days_in_month()',
docText: ''
def: 'days_in_month(v=vector(time()) instant-vector)',
docText: 'Returns number of days in the month for each of the given times in UTC. Returned values are from 28 to 31.'
},
{
name: 'delta()', value: 'delta',
def: 'delta()',
docText: ''
def: 'delta(v range-vector)',
docText: 'Calculates the difference between the first and last value of each time series element in a range vector `v`, 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.'
},
{
name: 'deriv()', value: 'deriv',
def: 'deriv()',
docText: ''
def: 'deriv(v range-vector)',
docText: 'Calculates the per-second derivative of the time series in a range vector `v`, using simple linear regression.'
},
{
name: 'drop_common_labels()', value: 'drop_common_labels',
def: 'drop_common_labels()',
docText: ''
def: 'drop_common_labels(instant-vector)',
docText: 'Drops all labels that have the same name and value across all series in the input vector.'
},
{
name: 'exp()', value: 'exp',
def: 'exp()',
docText: ''
def: 'exp(v instant-vector)',
docText: 'Calculates the exponential function for all elements in `v`.\nSpecial cases are:\n* `Exp(+Inf) = +Inf` \n* `Exp(NaN) = NaN`'
},
{
name: 'floor()', value: 'floor',
def: 'floor()',
docText: ''
def: 'floor(v instant-vector)',
docText: 'Rounds the sample values of all elements in `v` down to the nearest integer.'
},
{
name: 'histogram_quantile()', value: 'histogram_quantile',
def: 'histogram_quantile()',
docText: ''
def: 'histogram_quantile(φ float, b instant-vector)',
docText: 'Calculates the φ-quantile (0 ≤ φ ≤ 1) from the buckets `b` of a histogram. The samples in `b` are the counts of observations in each bucket. Each sample must have a label `le` where the label value denotes the inclusive upper bound of the bucket. (Samples without such a label are silently ignored.) The histogram metric type automatically provides time series with the `_bucket` suffix and the appropriate labels.'
},
{
name: 'holt_winters()', value: 'holt_winters',
def: 'holt_winters()',
docText: ''
def: 'holt_winters(v range-vector, sf scalar, tf scalar)',
docText: 'Produces a smoothed value for time series based on the range in `v`. The lower the smoothing factor `sf`, the more importance is given to old data. The higher the trend factor `tf`, the more trends in the data is considered. Both `sf` and `tf` must be between 0 and 1.'
},
{
name: 'hour()', value: 'hour',
def: 'hour()',
docText: ''
def: 'hour(v=vector(time()) instant-vector)',
docText: 'Returns the hour of the day for each of the given times in UTC. Returned values are from 0 to 23.'
},
{
name: 'idelta()', value: 'idelta',
def: 'idelta()',
docText: ''
def: 'idelta(v range-vector)',
docText: 'Calculates the difference between the last two samples in the range vector `v`, returning an instant vector with the given deltas and equivalent labels.'
},
{
name: 'increase()', value: 'increase',
def: 'increase()',
docText: ''
def: 'increase(v range-vector)',
docText: 'Calculates the increase in the time series in the range vector. Breaks in monotonicity (such as counter resets due to target restarts) are automatically adjusted for. The increase 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 a counter increases only by integer increments.'
},
{
name: 'irate()', value: 'irate',
def: 'irate()',
docText: ''
def: 'irate(v range-vector)',
docText: '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. Breaks in monotonicity (such as counter resets due to target restarts) are automatically adjusted for.'
},
{
name: 'label_replace()', value: 'label_replace',
def: 'label_replace()',
docText: ''
def: 'label_replace(v instant-vector, dst_label string, replacement string, src_label string, regex string)',
docText: 'For each timeseries in `v`, `label_replace(v instant-vector, dst_label string, replacement string, src_label string, regex string)` matches the regular expression `regex` against the label `src_label`. If it matches, then the timeseries is returned with the label `dst_label` replaced by the expansion of `replacement`. `$1` is replaced with the first matching subgroup, `$2` with the second etc. If the regular expression doesn\'t match then the timeseries is returned unchanged.'
},
{
name: 'ln()', value: 'ln',
def: 'ln()',
docText: ''
def: 'ln(v instant-vector)',
docText: 'calculates the natural logarithm for all elements in `v`.\nSpecial cases are:\n * `ln(+Inf) = +Inf`\n * `ln(0) = -Inf`\n * `ln(x < 0) = NaN`\n * `ln(NaN) = NaN`'
},
{
name: 'log2()', value: 'log2',
def: 'log2()',
docText: ''
def: 'log2(v instant-vector)',
docText: 'Calculates the binary logarithm for all elements in `v`. The special cases are equivalent to those in `ln`.'
},
{
name: 'log10()', value: 'log10',
def: 'log10()',
docText: ''
def: 'log10(v instant-vector)',
docText: 'Calculates the decimal logarithm for all elements in `v`. The special cases are equivalent to those in `ln`.'
},
{
name: 'minute()', value: 'minute',
def: 'minute()',
docText: ''
def: 'minute(v=vector(time()) instant-vector)',
docText: 'Returns the minute of the hour for each of the given times in UTC. Returned values are from 0 to 59.'
},
{
name: 'month()', value: 'month',
def: 'month()',
docText: ''
def: 'month(v=vector(time()) instant-vector)',
docText: '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.'
},
{
name: 'predict_linear()', value: 'predict_linear',
def: 'predict_linear()',
docText: ''
def: 'predict_linear(v range-vector, t scalar)',
docText: 'Predicts the value of time series `t` seconds from now, based on the range vector `v`, using simple linear regression.'
},
{
name: 'rate()', value: 'rate',
def: 'rate()',
docText: ''
def: 'rate(v range-vector)',
docText: "Calculates the per-second average rate of increase of the time series in the range vector. Breaks in monotonicity (such as counter resets due to target restarts) are automatically adjusted for. Also, the calculation extrapolates to the ends of the time range, allowing for missed scrapes or imperfect alignment of scrape cycles with the range's time period."
},
{
name: 'resets()', value: 'resets',
def: 'resets()',
docText: ''
def: 'resets(v range-vector)',
docText: '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 samples is interpreted as a counter reset.'
},
{
name: 'round()', value: 'round',
def: 'round()',
docText: ''
def: 'round(v instant-vector, to_nearest=1 scalar)',
docText: 'Rounds the sample values of all elements in `v` to the nearest integer. Ties are resolved by rounding up. The optional `to_nearest` argument allows specifying the nearest multiple to which the sample values should be rounded. This multiple may also be a fraction.'
},
{
name: 'scalar()', value: 'scalar',
def: 'scalar()',
docText: ''
def: 'scalar(v instant-vector)',
docText: 'Given a single-element input vector, `scalar(v instant-vector)` 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`.'
},
{
name: 'sort()', value: 'sort',
def: 'sort()',
docText: ''
def: 'sort(v instant-vector)',
docText: 'Returns vector elements sorted by their sample values, in ascending order.'
},
{
name: 'sort_desc()', value: 'sort_desc',
def: 'sort_desc()',
docText: ''
def: 'sort_desc(v instant-vector)',
docText: 'Returns vector elements sorted by their sample values, in descending order.'
},
{
name: 'sqrt()', value: 'sqrt',
def: 'sqrt()',
docText: ''
def: 'sqrt(v instant-vector)',
docText: 'Calculates the square root of all elements in `v`.'
},
{
name: 'time()', value: 'time',
def: 'time()',
docText: ''
docText: '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.'
},
{
name: 'vector()', value: 'vector',
def: 'vector()',
docText: ''
def: 'vector(s scalar)',
docText: 'Returns the scalar `s` as a vector with no labels.'
},
{
name: 'year()', value: 'year',
def: 'year()',
docText: ''
def: 'year(v=vector(time()) instant-vector)',
docText: 'Returns the year for each of the given times in UTC.'
},
{
name: 'avg_over_time()', value: 'avg_over_time',
def: 'avg_over_time()',
docText: ''
def: 'avg_over_time(range-vector)',
docText: 'The average value of all points in the specified interval.'
},
{
name: 'min_over_time()', value: 'min_over_time',
def: 'min_over_time()',
docText: ''
def: 'min_over_time(range-vector)',
docText: 'The minimum value of all points in the specified interval.'
},
{
name: 'max_over_time()', value: 'max_over_time',
def: 'max_over_time()',
docText: ''
def: 'max_over_time(range-vector)',
docText: 'The maximum value of all points in the specified interval.'
},
{
name: 'sum_over_time()', value: 'sum_over_time',
def: 'sum_over_time()',
docText: ''
def: 'sum_over_time(range-vector)',
docText: 'The sum of all values in the specified interval.'
},
{
name: 'count_over_time()', value: 'count_over_time',
def: 'count_over_time()',
docText: ''
def: 'count_over_time(range-vector)',
docText: 'The count of all values in the specified interval.'
},
{
name: 'quantile_over_time()', value: 'quantile_over_time',
def: 'quantile_over_time()',
docText: ''
def: 'quantile_over_time(scalar, range-vector)',
docText: 'The φ-quantile (0 ≤ φ ≤ 1) of the values in the specified interval.'
},
{
name: 'stddev_over_time()', value: 'stddev_over_time',
def: 'stddev_over_time()',
docText: ''
def: 'stddev_over_time(range-vector)',
docText: 'The population standard deviation of the values in the specified interval.'
},
{
name: 'stdvar_over_time()', value: 'stdvar_over_time',
def: 'stdvar_over_time()',
docText: ''
def: 'stdvar_over_time(range-vector)',
docText: 'The population standard variance of the values in the specified interval.'
},
];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment