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 upDoing group_left() multiplication (left cardinality > right side) while also wanting to add a 1:1 matching label from the right side #1503
Comments
brian-brazil
added
the
feature-request
label
Mar 24, 2016
This comment has been minimized.
This comment has been minimized.
|
This is not presently possible, it's on my todo list to figure out what semantics change is needed on group_left to enable this (hopefully without adding more keywords). |
This comment has been minimized.
This comment has been minimized.
|
I've been thinking on this a bit, and think I've got a solution. We want something that works for both the node_cpu case where there's an extra label on the many side, and also in the machine role case where we want to copy over labels from the one side. In both cases we want to keep all labels from the many side (particularly if you're using What I propose is two fold: First just as for Secondly I propose that the labels listed in the The node_cpu case would look like The machine role case would look like |
This comment has been minimized.
This comment has been minimized.
|
So to clarify: the labels from the many side will always be used, in addition the labels specified in |
This comment has been minimized.
This comment has been minimized.
|
Yes. I don't think there's a sane use with the |
This comment has been minimized.
This comment has been minimized.
|
I tried to wrap my head around this, and so far I think this looks good. Any other opinions? Should we turn this into a GH issue to kickstart implementation?Björn Rabenstein, Engineer SoundCloud Ltd. | Rheinsberger Str. 76/77, 10115 Berlin, Germany |
This comment has been minimized.
This comment has been minimized.
|
It's a GH issue already :) |
This comment has been minimized.
This comment has been minimized.
|
This seems to work |
This comment has been minimized.
This comment has been minimized.
|
|
brian-brazil
referenced this issue
Apr 16, 2016
Merged
Add error message if old alert rule tokens are read #1561
This comment has been minimized.
This comment has been minimized.
|
I've implemented this now in #1571. I've broken it into stages so you can see the rules at various stages, what must change and how rules can get a bit cleaner. There's a corner case where someone wants to copy a label over from a metric with no common labels. If that was workable with I then looked at tweaking Where this doesn't feel right is that in one-to-one cases Our two options then are to either not support the corner case and drop The one disadvantage of this is that it scuppers any hope of a graceful transition for users, as we're changing the existing
|
This comment has been minimized.
This comment has been minimized.
I think the two different semantics are acceptable as they go along with a |
This comment has been minimized.
This comment has been minimized.
|
We could even rationalize it as follows: The default semantics is to keep all labels from the grouping side. If there is no grouping side defined, only the matching labels can be kept to retain symmetry. |
fabxc
added this to the v1.0.0 milestone
Apr 25, 2016
brian-brazil
added a commit
that referenced
this issue
Apr 26, 2016
grobie
closed this
Apr 27, 2016
This comment has been minimized.
This comment has been minimized.
|
Thanks @brian-brazil for tackling this :) |
This comment has been minimized.
This comment has been minimized.
lock
bot
commented
Mar 24, 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. |
jjo commentedMar 24, 2016
I'd like to compose a query to 'add'
nodenamelabel (as provided bynode_uname_infometric from node_exporter) by matching it againstinstance- this is easy to do when there's no extra cardinality thaninstanceitself on the left-side - e.g. this works ok:node_load1 * on (instance) group_right(nodename) node_uname_infoBut then left-side has 'more cardinality' (more labels than just
instance,in this case I want to 'keep'
device), I can't find a way to do it.Take below example:
rate(node_disk_reads_completed[1m])node_uname_info=> below expression is valid but obviously doesn't keep
nodenamefromnode_uname_info(i.e. a useless/no-op in this case):rate(node_disk_reads_completed[1m]) * on (instance) group_left(device) node_uname_info=> then the one below is invalid:
(while I'd love it to be ok ;-), knowing the right side would be a 1:1 mapping):
rate(node_disk_reads_completed[1m]) * on (instance) group_left(device) group_right(nodename) node_uname_infoAnyway to do above, with current operators support ?