Skip to content

Commit

Permalink
Improve scalar literal format documentation (prometheus#7651)
Browse files Browse the repository at this point in the history
* Improve scalar literal format documentation

Signed-off-by: Julius Volz <julius.volz@gmail.com>

* Address review comments

Signed-off-by: Julius Volz <julius.volz@gmail.com>

* Fixup

Signed-off-by: Julius Volz <julius.volz@gmail.com>
  • Loading branch information
juliusv committed Jul 25, 2020
1 parent 22acb87 commit 9da59c8
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions docs/querying/basics.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,23 @@ Example:

### Float literals

Scalar float values can be literally written as numbers of the form
`[-](digits)[.(digits)]`.
Scalar float values can be written as literal integer or floating-point numbers in the format (whitespace only included for better readability):

[-+]?(
[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?
| 0[xX][0-9a-fA-F]+
| [nN][aA][nN]
| [iI][nN][fF]
)

Examples:

23
-2.43
3.4e-9
0x8f
-Inf
NaN

## Time series Selectors

Expand Down Expand Up @@ -180,7 +193,7 @@ The same works for range vectors. This returns the 5-minute rate that

## Subquery

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

Syntax: `<instant_query> '[' <range> ':' [<resolution>] ']' [ offset <duration> ]`

Expand Down

0 comments on commit 9da59c8

Please sign in to comment.