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 upSupport differentiation between empty label and non-existing labels in k8 #3726
Comments
brian-brazil
added
the
component/service discovery
label
Jan 23, 2018
This comment has been minimized.
This comment has been minimized.
|
This is not something we can really handle in relabelling, however service discovery could provide additional metadata to make this possible. |
This comment has been minimized.
This comment has been minimized.
|
What would the solution look like here? A new |
This comment has been minimized.
This comment has been minimized.
|
We'd either add a new metadata entry that is a list with a list of all labels/annotations that are present, or a label per k8 label that has the value true. |
This comment has been minimized.
This comment has been minimized.
|
Not sure how the "label per k8 label that has the value true" should work (the value is "" for these labels) but a entry with a list of all labels/annotations sounds like a good idea. |
This comment has been minimized.
This comment has been minimized.
|
I'm saying we could represent this as either a list, or a map. A map may be easier for users to use, but is more verbose. |
This comment has been minimized.
This comment has been minimized.
|
Ah got it.. hrm Isee, yeah checking if something is set or not would be indeed easier to do with a map. I'm fine either way. |
brian-brazil
changed the title
Support differentiation between empty label and non-existing labels in relabling
Support differentiation between empty label and non-existing labels in k8
Feb 2, 2018
This comment has been minimized.
This comment has been minimized.
Quentin-M
commented
Feb 13, 2018
|
+1 This makes it hard to monitor master and worker nodes separately. |
This comment has been minimized.
This comment has been minimized.
|
At least for all the "official" |
brian-brazil
added
kind/enhancement
priority/P3
labels
Mar 8, 2018
brian-brazil
added
the
low hanging fruit
label
Jun 13, 2018
gouthamve
added
the
help wanted
label
Jan 29, 2019
This comment has been minimized.
This comment has been minimized.
nevill
commented
Mar 10, 2019
This comment has been minimized.
This comment has been minimized.
Quentin-M
commented
Mar 11, 2019
|
@nevill Not because it is not part of the codebase, that it is not the upstream standard. |
discordianfish commentedJan 23, 2018
What did you do?
I've tried to use the Kubernetes SD and relabling to only scrape master nodes. In Kubernetes, master nodes are tagged with the label:
node-role.kubernetes.io/master: ""which becomes__meta_kubernetes_node_label_node_role_kubernetes_io_master=""in Prometheus after sanitizing.Unfortunately this doesn't seem to be possible with relabling because it's not possible to differentiate between a nonexisting and empty label. This for example will always match, since if the key doesn't exist the regexp gets matched against "".