-
Notifications
You must be signed in to change notification settings - Fork 813
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
[auto_conf] Allow multiple instances per check #3311
[auto_conf] Allow multiple instances per check #3311
Conversation
In some cases (and for some checks), it makes sense to have multiple instances of the same check running against a container. Example: `php_fpm` check when the user wants to check multiple `status_url`s. So. instead of only taking into account the first instance, take into account all of them.
Could this also affect service discovery? I'm currently experiencing a similar issue with service discovery / kubernetes annotations taking only the 1st instance defined in the annotations for a check. |
@aerostitch This issue shouldn't be affecting kubernetes annotations (or, at least, what the present PR changes should have no effect on the way kubernetes annotations are pulled by the agent). Feel free to contact our support team at support@datadoghq.com and send them a flare if you're having issues setting up kubernetes annotations for the Agent, they'll be able to ask for more specific information about your setup. |
I've already done that, I was just checking, as the behavior seems very similar, if that was related.
made me think that this could be what I was looking for as, when I use the I'm actually not sure if the issue is when the config is pulled from Kubernetes or when it's pushed in the datadog config. |
Oh okay, hmm the comments on top of the snippet you copied are a bit misleading, but for what this PR fixes the issue lies in the function that's called here: https://github.com/DataDog/dd-agent/blob/5.13.0/utils/service_discovery/abstract_config_store.py#L287 , so it's definitely unrelated with your issue. |
Thanks for the quick answer. |
Just a note: once #3341 is merged you could use the image_3 and image_4 examples I added to the tests for this. Should be pretty straightforward. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, we could indeed extend the tests for that though, see previous comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, fits well with #3341 (will also require some documentation)
What does this PR do?
Allows configuring multiple instances of the same check with
auto_conf
.Motivation
In some cases (and for some checks), it makes sense to have multiple
instances of the same check running against a container. Example:
php_fpm
check when the user wants to run the check against multiplestatus_url
s.Testing Guidelines
I did some basic manual testing. Haven't written unit tests but if needed I can add some.
Additional Notes
Opening this PR after discussing with @sdwr98 on a use case for #3259 (the use case being: having the ability to define multiple instances of the same check with
auto_conf
, which is useful forphp_fpm
for example)