https://prometheus.io/docs/introduction/overview/
Data
- Sample, 二维数据,包含一个float64 value和一个timestamp
Metric Type
The Prometheus server does not yet make use of the type information and flattens all data into untyped time series
- Counter
- Gauge
- Histogram
- Summary
Query
Expression Data Types
- Instant vector - a set of time series containing a single sample for each time series, all sharing the same timestamp
- Range vector - a set of time series containing a range of data points over time for each time series
- Scalar - a simple numeric floating point value
- String - a simple string value; currently unused
an expression that returns an instant vector is the only type that can be directly graphed.
Literals
String
Strings may be specified as literals in single quotes, double quotes or backticks.
Float literals
Time series Selectors
Instant vector selectors
- regex
- {name='metric_name'}
Range Vector Selectors
- a set of instant time series
Duration
Offset
Note that the offset modifier always needs to follow the selector immediately
@ modifier
Operator
- matching behavior between two instant vector
Binary
Arithmetic binary operators
- scalar/scalar, instant vector/scalar, instant vector/instant vector
Trigonometric binary operators
- vector/vector
Comparison binary operators
- scalar/scalar, vector/scalar, vector/vector
- > bool 0.5
Logical/set binary operators
- vector/vector
- and, or, unlesss
- match all in the right by default
Vector matching
- on, ignoring
- group_left, group_right