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 upMaking joins simpler in PromQL #3094
Comments
RichiH
added
component/promql
kind/enhancement
labels
Aug 20, 2017
brian-brazil
added
the
priority/Pmaybe
label
Aug 20, 2017
This comment has been minimized.
This comment has been minimized.
|
I've pondered this previously, and haven't been able to come up with anything. Tooling on the Grafana end is likely going to be a more fruitful approach. |
This comment has been minimized.
This comment has been minimized.
Yes, we need thisThat it is hard does not mean we don't need it. Solving this in Grafana is not enough, I am frequently missing this both during exploration and in alerting. Having to construct long instance match regexes is not a solution, it takes a long time to assemble, makes the queries completely unreadable, and for large lists plain fails. Mockup (proposal)I'm imagining a
by matching on the labels in the on clause, taking the remaining labels from both sides (favouring left in case of conflict) and the value from the left side:
Open questionsWhat would the meaning of group_left / group_right be in this context? They could of course just be illegal. How would I limit which labels get joined? Do I need this capability? It could be emulated with label_replace. Real-world use-caseThe above is distilled from the following use case: Given the request latency of an instance in Kubernetes, |
This comment has been minimized.
This comment has been minimized.
I'm not seeing how this is relevant to this issue.
I'm not particularly in favour of such a joining, as the nature of info metrics is that they contain an unknown and changing set of label names over time. Thus taking all the labels from the right means you no longer know what the labels of the output are, and thus breaks
That's what group_left already does, and this capability is essential for semantic sanity.
I don't see how the proposed change makes this significantly easier than what we have already, in fact it's likely to cause problems due to also pulling in all the other labels. |
This comment has been minimized.
This comment has been minimized.
It's how we work around joins not being simple.
Curious, I use
Ah, so this is possible already? How? |
This comment has been minimized.
This comment has been minimized.
Can you explain exactly what you're doing right now? Selectors are orthogonal to joins.
Thus why we need to be careful about keeping the set of in-play labels sufficiently knowable. Pulling in all labels from both sides of an expression where one side is an _info doesn't allow for that.
I'd need to see the exact metrics, but it'd be something like |
This comment has been minimized.
This comment has been minimized.
Out of band, we collect lists of hostnames for whatever we're interested in, and concatenate them into |
This comment has been minimized.
This comment has been minimized.
|
That'd be pretty awkward alright. |
This comment has been minimized.
This comment has been minimized.
hanikesn
commented
Dec 13, 2017
|
We're also having trouble with the current |
This comment has been minimized.
This comment has been minimized.
|
If you don't know the names of the labels you want to aggregate by, you're going to find it fairly difficult to do anything. |
RichiH commentedAug 20, 2017
At yesterday's dev summit, and as part of the discussion around prometheus/snmp_exporter#180 , @brian-brazil also suggested making joins easier to write.
This issue is to document possible changes / enhancements to PromQL.