-
Notifications
You must be signed in to change notification settings - Fork 224
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
Remove datadog checks #151
Conversation
thanks @Jno21, much needed, especially in the beginning of integration when the velocity of changes to these checks are high from testing/optimizing/rearrangingu integrations. Been burned a couple of times not realizing old checks were still running |
@Jno21 Sorry about the long delay here. I'm currently testing this and it looks pretty good so far. Your branch is now out of sync with master, would you mind rebasing it on master then (we've split the agent 6 yaml file in 2 - Linux and Windows, and removed support for agent 5 on Windows) |
3cb7e5b
to
f6a9ad6
Compare
Hi, Sorry about the delay also. I rebased to be in sync with master, I also did it for Windows (I couldn't test it tho, so I am not 100% sure about it). |
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.
Left a couple of notes, thanks for getting back to us!
Is there any advancement on this? I'd love to be able to use this role without relying on @Jno21's fork! Thanks. |
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.
Thanks for the PR! I left some questions and suggestions.
There's a merge conflict because the README got updated on master (the list of attributes has become a table), could you update your PR to resolve the conflict?
tasks/agent5-linux.yml
Outdated
find: | ||
paths: /etc/dd-agent/conf.d/ | ||
pattern: "*.yaml" | ||
file_type: directory |
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.
On Agent 5, this directly matches files (as there are no <check>.d
folders), so the file type should be changed accordingly (otherwise Ansible doesn't match anything since there are no directories ending in .yaml
)
file_type: directory | |
file_type: file |
|
||
- name: Delete checks not present in datadog_tracked_checks | ||
file: | ||
path: "/etc/dd-agent/conf.d/{{ item }}.yaml" |
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.
This will remove any user-defined configuration of the checks, but in the case of core checks (disk, memory, etc.), they will still be running with the default configuration, as the default config file ({{ item }}.yaml.default
) will still be present.
Is this expected? Or should the default files also be removed?
(Same question for Agent 6, with the conf.d/{{ item }}.d/conf.yaml.default
files)
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.
While it would be useful to keep them as a base case, I think it'll make things a lot complexer when people start modifying the defaults - and there are likely use cases where you want to remove the defaults anyway.
Maybe an additional config option (datadog_disable_default_checks
)?
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.
Hey ! I followed @lesteenman idea by adding a datadog_disable_default_checks
option (true or false). So it will remove all defaults checks or not.
If you want to go further with the idea you can pick it up to choose which one you will prefer to remove (list).
README.md
Outdated
@@ -29,6 +29,8 @@ Role Variables | |||
- `datadog_checks` - YAML configuration for agent checks to drop into: | |||
+ `/etc/datadog-agent/conf.d/<check_name>.d/conf.yaml` for agent6 | |||
+ `/etc/dd-agent/conf.d` for agent5. | |||
- `datadog_disable_untracked_checks` - Set to `true` to remove all checks not present in `datadog_checks` and `datadog_additional_checks`. | |||
- `datadog_additional_checks`: List of additional checks that won't be remove if `datadog_disable_untracked_checks` is set to `true`. |
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.
- `datadog_additional_checks`: List of additional checks that won't be remove if `datadog_disable_untracked_checks` is set to `true`. | |
- `datadog_additional_checks`: List of additional checks that won't be removed if `datadog_disable_untracked_checks` is set to `true`. |
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.
Done
@Jno21, do you plan to finish this PR? I might be able to pick it up otherwise. |
2edb3da
to
217ed89
Compare
Hey ! Sorry for the long wait, I made corrections like asked and added the idea of @lesteenman ! |
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.
small grammar fix, otherwise good from a documentation perspective.
Co-authored-by: Kari Halsted <[email protected]>
Thanks for your PR and sorry for the (very long) wait 🙇 LGTM and merging! 👍 |
This PR is a proposal for the issue 43.
By setting:
datadog_disable_untracked_checks
totrue
all the files that are not indatadog_checks
anddatadog_additional_checks
will be removed.datadog_additional_checks
allow you to add some checks that won't be remove while running the ansible role withdatadog_disable_untracked_checks: true
.If you have any feedback it will be appreciated, I am still new to Ansible :)