Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
docs
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
docs
Commits
3e63893f
Commit
3e63893f
authored
Sep 03, 2016
by
beorn7
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'next-release'
Prometheus v1.1.0 is released!
parents
b38d8289
704b23ba
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
63 additions
and
9 deletions
+63
-9
functions.md
content/docs/querying/functions.md
+53
-2
operators.md
content/docs/querying/operators.md
+8
-7
template_reference.md
content/docs/visualization/template_reference.md
+2
-0
No files found.
content/docs/querying/functions.md
View file @
3e63893f
...
@@ -6,14 +6,19 @@ sort_rank: 3
...
@@ -6,14 +6,19 @@ sort_rank: 3
# Functions
# Functions
Some functions have default arguments, e.g.
`year(v=vector(time())
instant-vector)`
. This means that there is one argument
`v`
which is an instant
vector, which if not provided it will default to the value of the expression
`vector(time())`
.
## `abs()`
## `abs()`
`abs(v vector)`
returns the input vector with all sample values converted to
`abs(v
instant-
vector)`
returns the input vector with all sample values converted to
their absolute value.
their absolute value.
## `absent()`
## `absent()`
`absent(v vector)`
returns an empty vector if the vector passed to it has any
`absent(v
instant-
vector)`
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
elements and a 1-element vector with the value 1 if the vector passed to it has
no elements.
no elements.
...
@@ -63,6 +68,22 @@ vector as a scalar. This is in contrast to the `count()`
...
@@ -63,6 +68,22 @@ vector as a scalar. This is in contrast to the `count()`
always returns a vector (an empty one if the input vector is empty) and allows
always returns a vector (an empty one if the input vector is empty) and allows
grouping by labels via a
`by`
clause.
grouping by labels via a
`by`
clause.
## `day_of_month()`
`day_of_month(v=vector(time()) instant-vector)`
returns the day of the month
for each of the given times in UTC. Returned values are from 1 to 31.
## `day_of_week()`
`day_of_week(v=vector(time()) instant-vector)`
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.
## `days_in_month()`
`days_in_month(v=vector(time()) instant-vector)`
returns number of days in the
month for each of the given times in UTC. Returned values are from 28 to 31.
## `delta()`
## `delta()`
`delta(v range-vector)`
calculates the difference between the
`delta(v range-vector)`
calculates the difference between the
...
@@ -162,6 +183,21 @@ more trends in the data is considered. Both `sf` and `tf` must be between 0 and
...
@@ -162,6 +183,21 @@ more trends in the data is considered. Both `sf` and `tf` must be between 0 and
`holt_winters`
should only be used with gauges.
`holt_winters`
should only be used with gauges.
## `hour()`
`hour(v=vector(time()) instant-vector)`
returns the hour of the day
for each of the given times in UTC. Returned values are from 0 to 23.
## `idelta()`
`idelta(v range-vector)`
`idelta(v range-vector)`
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.
## `increase()`
## `increase()`
`increase(v range-vector)`
calculates the increase in the
`increase(v range-vector)`
calculates the increase in the
...
@@ -241,6 +277,12 @@ The special cases are equivalent to those in `ln`.
...
@@ -241,6 +277,12 @@ The special cases are equivalent to those in `ln`.
`log10(v instant-vector)`
calculates the decimal logarithm for all elements in
`v`
.
`log10(v instant-vector)`
calculates the decimal logarithm for all elements in
`v`
.
The special cases are equivalent to those in
`ln`
.
The special cases are equivalent to those in
`ln`
.
## `month()`
`month(v=vector(time()) instant-vector)`
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.
## `predict_linear()`
## `predict_linear()`
`predict_linear(v range-vector, t scalar)`
predicts the value of time series
`predict_linear(v range-vector, t scalar)`
predicts the value of time series
...
@@ -315,6 +357,12 @@ expression is to be evaluated.
...
@@ -315,6 +357,12 @@ expression is to be evaluated.
`vector(s scalar)`
returns the scalar
`s`
as a vector with no labels.
`vector(s scalar)`
returns the scalar
`s`
as a vector with no labels.
## `year()`
`year(v=vector(time()) instant-vector)`
returns the year
for each of the given times in UTC.
## `<aggregation>_over_time()`
## `<aggregation>_over_time()`
The following functions allow aggregating each series of a given range vector
The following functions allow aggregating each series of a given range vector
...
@@ -325,6 +373,9 @@ over time and return an instant vector with per-series aggregation results:
...
@@ -325,6 +373,9 @@ over time and return an instant vector with per-series aggregation results:
*
`max_over_time(range-vector)`
: the maximum value of all points in the specified interval.
*
`max_over_time(range-vector)`
: the maximum value of all points in the specified interval.
*
`sum_over_time(range-vector)`
: the sum of all values in the specified interval.
*
`sum_over_time(range-vector)`
: the sum of all values in the specified interval.
*
`count_over_time(range-vector)`
: the count of all values in the specified interval.
*
`count_over_time(range-vector)`
: the count of all values in the specified interval.
*
`quantile_over_time(scalar, range-vector)`
: the φ-quantile (0 ≤ φ ≤ 1) of the values in the specified interval.
*
`stddev_over_time(range-vector)`
: the population standard deviation of the values in the specified interval.
*
`stdvar_over_time(range-vector)`
: the population standard variance of the values in the specified interval.
Note that all values in the specified interval have the same weight in the
Note that all values in the specified interval have the same weight in the
aggregation even if the values are not equally spaced throughout the interval.
aggregation even if the values are not equally spaced throughout the interval.
content/docs/querying/operators.md
View file @
3e63893f
...
@@ -189,19 +189,20 @@ vector of fewer elements with aggregated values:
...
@@ -189,19 +189,20 @@ vector of fewer elements with aggregated values:
*
`count_values`
(count number of elements with the same value)
*
`count_values`
(count number of elements with the same value)
*
`bottomk`
(smallest k elements by sample value)
*
`bottomk`
(smallest k elements by sample value)
*
`topk`
(largest k elements by sample value)
*
`topk`
(largest k elements by sample value)
*
`quantile`
(calculate φ-quantile (0 ≤ φ ≤ 1) over dimensions)
These operators can either be used to aggregate over
**all**
label dimensions
These operators can either be used to aggregate over
**all**
label dimensions
or preserve distinct dimensions by including a
`without`
or
`by`
clause.
or preserve distinct dimensions by including a
`without`
or
`by`
clause.
<aggr-op>([parameter,] <vector expression>) [without|by (<label list>)] [keep_common]
<aggr-op>([parameter,] <vector expression>) [without|by (<label list>)] [keep_common]
`parameter`
is only required for
`count_values`
,
`topk`
and
`bottomk`
.
`without`
`parameter`
is only required for
`count_values`
,
`quantile`
,
`topk`
and
removes the listed labels from the result vector, while all other labels ar
e
`bottomk`
.
`without`
removes the listed labels from the result vector, whil
e
preserved the output.
`by`
does the opposite and drops labels that are not
all other labels are preserved the output.
`by`
does the opposite and drops
l
isted in the
`by`
clause, even if their label values are identical between all
l
abels that are not listed in the
`by`
clause, even if their label values are
elements of the vector. The
`keep_common`
clause allows keeping those extra
identical between all elements of the vector. The
`keep_common`
clause allows
labels (labels that are identical between elements, but not in the
`by`
keeping those extra labels (labels that are identical between elements, but not
clause).
in the
`by`
clause).
`count_values`
outputs one time series per unique sample value. Each series has
`count_values`
outputs one time series per unique sample value. Each series has
an additional label. The name of that label is given by the aggregation
an additional label. The name of that label is given by the aggregation
...
...
content/docs/visualization/template_reference.md
View file @
3e63893f
...
@@ -65,6 +65,8 @@ versions.
...
@@ -65,6 +65,8 @@ versions.
| Name | Arguments | Returns | Notes |
| Name | Arguments | Returns | Notes |
| ------------- | ------------- | ------- | ----------- |
| ------------- | ------------- | ------- | ----------- |
| title | string | string |
[
strings.Title
](
http://golang.org/pkg/strings/#Title
)
, capitalises first character of each word.|
| title | string | string |
[
strings.Title
](
http://golang.org/pkg/strings/#Title
)
, capitalises first character of each word.|
| toUpper | string | string |
[
strings.ToUpper
](
http://golang.org/pkg/strings/#ToUpper
)
, converts all characters to upper case.|
| toLower | string | string |
[
strings.ToLower
](
http://golang.org/pkg/strings/#ToLower
)
, converts all characters to lower case.|
| match | pattern, text | boolean |
[
regexp.MatchString
](
http://golang.org/pkg/regexp/#MatchString
)
Tests for a unanchored regexp match. |
| match | pattern, text | boolean |
[
regexp.MatchString
](
http://golang.org/pkg/regexp/#MatchString
)
Tests for a unanchored regexp match. |
| reReplaceAll | pattern, replacement, text | string |
[
Regexp.ReplaceAllString
](
http://golang.org/pkg/regexp/#Regexp.ReplaceAllString
)
Regexp substitution, unanchored. |
| reReplaceAll | pattern, replacement, text | string |
[
Regexp.ReplaceAllString
](
http://golang.org/pkg/regexp/#Regexp.ReplaceAllString
)
Regexp substitution, unanchored. |
| graphLink | expr | string | Returns path to graph view in the
[
expression browser
](
/docs/visualization/browser/
)
for the expression. |
| graphLink | expr | string | Returns path to graph view in the
[
expression browser
](
/docs/visualization/browser/
)
for the expression. |
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment