Prometheus Precedence Operators
In Prometheus there are no specific precedence operators like those found in programming languages. However, Prometheus Query Language (PromQL) does have a specific order of evaluation for its functions and operators. The order of evaluation is as follows:
1. Parentheses: Expressions inside parentheses are evaluated first.
2. Unary Operators: Unary operators like "-" (negation) and "+" (identity) are evaluated next.
3. Multiplication and Division: The "*" (multiplication) and "/" (division) operators are evaluated from left to right.
4. Addition and Subtraction: The "+" (addition) and "-" (subtraction) operators are evaluated from left to right.
5. Comparison Operators: Comparison operators like "==" (equal), "!=" (not equal), "<" (less than), ">" (greater than), "<=" (less than or equal to), and ">=" (greater than or equal to) are evaluated next.
6. Logical Operators: Logical operators like "and", "or", and "unless" are evaluated from left to right.
It's important to note that Prometheus evaluates expressions strictly from left to right, without any operator precedence rules to override the default order.