vector()

The vector() function receives a scalar value as a parameter and returns a vector with no labels with the value of the specified scalar argument.

For example, query the following expression:

vector(42)

It will return the following:

{} 42

This is normally used as a way of ensuring an expression always has at least one result, by combining a vector expression with it, like in the following code:

http_requests_total{handler="/"} or vector(0)

Since the or operator returns both sides, a sample with the value 0 will always be present.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.118.102.225