Closed Nalum closed 7 years ago
Maybe you should read this prometheus docs about without operator, hope this would be helpful.
https://prometheus.io/docs/querying/operators/#aggregation-operators
These operators can either be used to aggregate over all label dimensions or preserve distinct dimensions by including a without or by clause.
<aggr-op>([parameter,] <vector expression>) [without|by (<label list>)] [keep_common]
parameter is only required for count_values, quantile, topk and bottomk. without removes the listed labels from the result vector, while all other labels are preserved the output. by does the opposite and drops labels that are not listed in the by clause, even if their label values are identical between all elements of the vector. The keep_common clause allows keeping those extra labels (labels that are identical between elements, but not in the by clause).
That talks about the labels being different, which is not what my question is about.
I guess my question is really should code="total"
be equal to the sum of the other code
values? If it is i would expect the output of the two queries above to be the same.
Maybe you could try the same PromSQL twice, and you will also see the difference :-)
And yes, code="total"
should be equal to the sum of the other code values absolutely
I'm not sure if I get it or not so just wanted to ask to be sure.
Should the first prometheus query result in the same value as the second prometheus query?
1.
2.
If they should be the same, I think there is an issue as I'm seeing a discrepency. I get the values below for these two queries.
1.
2.