Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upPerforming application of labels: no grouping allowed for "and" operation #2670
Comments
This comment has been minimized.
This comment has been minimized.
|
I don't see how this helps you though. Your last example would (after fixing the syntax error as May I suggest a feature request to k8 to have the kubelet expose allocated cores? PromQL questions are best asked at https://groups.google.com/forum/#!aboutgroup/prometheus-users |
brian-brazil
closed this
May 1, 2017
This comment has been minimized.
This comment has been minimized.
|
Brian, Sorry, but I don't really understand your answer here. First of all, why should I do a feature request at k8s to ask them to change the metrics format? The metrics format is all right as it is right now. In our case, Prometheus' Kubernetes service discovery adds the Also your remark that grouping is already supported without any additional modifiers: doesn't the use case described above demonstrate that the existing mechanism is not sufficient? Right now On a final note, why close this bug report already? If you provided a query that literally showed me that the existing query language is already capable of doing this, I'd agree that closing makes sense. Right now we haven't reached any consensus yet. |
This comment has been minimized.
This comment has been minimized.
That you have to write such complex PromQL queries indicates otherwise.
That's not how it works.
I see no behaviour here which indicates a bug in PromQL. Our policy is to close the many user support questions we get and redirect them to the mailing list, so that everyone can benefit from the answer. |
This comment has been minimized.
This comment has been minimized.
lock
bot
commented
Mar 23, 2019
|
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
EdSchouten commentedMay 1, 2017
•
edited
[ This bug report applies to Prometheus 1.6.1 ]
Consider the following metrics, generated by Kubernetes/CAdvisor:
And these metrics, generated by kube-state-metrics:
The question is, how can one compute the CPU request utilisation per
k8s_node_type? In this specific example, it's annoying thatkube_pod_container_requested_cpu_coresdoes not have ak8s_node_typelabel. We somehow want to copy that label frommachine_cpu_coreswhile aggregating. I came up with recording rules that look like this:Though this recording rule works pretty well, I'm not happy with this part:
In this case I'm just looking for a binary operator that retains the left hand side;
a ⨂ b = a. The addition and the multiplication by zero effectively emulate this, as I knowmachine_cpu_coresis never NaN.Interestingly enough, Prometheus already has an operator that does
a ⨂ b = a: it's calledand. My question is, could we please extendandto also allow grouping? It would be nicer if I could write:I understand that having grouping for the
oroperator is harder, as that is effectively a selection between the left hand side and the right hand side. Theandoperator, however, is semantically not very different from other operators like+,*, etc., right?