-
Notifications
You must be signed in to change notification settings - Fork 148
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conditions with dots in label name does not work as expected #1284
Comments
CC @elastic/obs-cloudnative-monitoring |
Hello @barkbay, Have you tried with a different condition (still with |
It's really odd:
with
with
So, yes, it does not seem to be related to the I would really appreciate if you could try to reproduce on your end in standalone mode. |
@barkbay can you try and replace the condition with |
The reason is labels are dedoted by default meaning that a label containing a dot ( The problem is that this is not documented and also annotations do not follow the same approach as @gsantoro mentioned in #1284 (comment). |
Thanks for your help. I moved to an annotation in the meantime, and everything is now working as expected (using dots). I'm not sure I'll have the time to test replacing Feel free to close this issue or keep it open as a way to track that this behaviour should be reflected in the documentation. Thanks again 🙇 |
You are welcome. I will keep this open as except from the missing documentation around this, we would like the behaviour between labels and annotations to be the same. I believe it makes more sense that users use in conditions matching, the labels/annotations exactly as they have added them in the pod/resource, instead of the dedoted way they are stored in elasticsearch. @elastic/obs-cloudnative-monitoring , @gizas |
Fixed by #1398 in elastic-agent and elastic/beats#33240 in beats. |
For confirmed bugs, please report:
Autodiscover conditions does not seem to work if there is a
/
in a K8S Pod's label name used in the condition.In my use case I want to collect Prometheus metrics from Pods with the
app.kubernetes.io/name: global-controllers
label:Here is the standalone config I'm using:
If I use a label name without a
/
(for exampleapp :foo
), and I update the condition tocondition: ${kubernetes.labels.app} == 'foo'
, then Agent collects the metrics as expected.The text was updated successfully, but these errors were encountered: