@ -88,15 +93,23 @@ The following aggregations functions are included: `Min`, `Max`, `Mean`, `Mediam
### Math
### Math
Performs free-form math functions/operations on time series data and numbers. For instance, `$A + 1` or `$A * 100`.
Performs free-form math functions/operations on time series data and numbers. For example, `$A + 1` or `$A * 100`.
If queries being compared have **multiple series in their results**, series from different queries are matched(joined) if they have the same labels. For example:
- `$A` returns series `{host=web01} 30` and `{host=web02} 20`
- `$B` returns series `{host=web01} 10` and `{host=web02} 0`
- `$A + $B` returns `{host=web01} 40` and `{host=web02} 20`.
You can also use a Math expression to define the alert condition for numbers. For example:
In this case, only series with matching labels are joined, and the operation is calculated between them.
For additional scenarios on how Math handles different data types, refer to the [Math documentation](ref:math-operation).
You can also use a Math expression to define the **alert condition**. For example:
- `$B > 70` should fire if the value of B (query or expression) is more than 70.
- `$B > 70` should fire if the value of B (query or expression) is more than 70.
- `$B < $C * 100` should fire if the value of B is less than the value of C multiplied by 100.
- `$B < $C * 100` should fire if the value of B is less than the value of C multiplied by 100.
If queries being compared have multiple series in their results, series from different queries are matched if they have the same labels or one is a subset of the other.
### Resample
### Resample
Realigns a time range to a new set of timestamps, this is useful when comparing time series data from different data sources where the timestamps would otherwise not align.
Realigns a time range to a new set of timestamps, this is useful when comparing time series data from different data sources where the timestamps would otherwise not align.