Skip to content
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

Speed up the conf.d checks #584

Merged
merged 1 commit into from
Jul 18, 2024

Conversation

a-rhodes
Copy link
Contributor

When using the config options datadog_disable_untracked_checks, datadog_disable_default_checks or datadog_disable_example_checks, the Ansible run is very slow as it runs a separate task for every directory in the conf.d folder.

Instead, if we change the find call to look for conf.yaml* files in the subdirectories, we can filter the results and target specifically what we need, resulting in a much faster role.

@a-rhodes a-rhodes requested a review from a team as a code owner July 16, 2024 18:33
@a-rhodes a-rhodes force-pushed the arhodes_faster_conf_check branch from 7c5c39e to a4eb5a4 Compare July 16, 2024 18:39
Copy link
Contributor

@alopezz alopezz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👋 Hi, thanks for the PR!

I've tried to test it against a Ubuntu VM, setting datadog_disable_untracked_checks: true and I get this error:

TASK [datadog.datadog : Delete checks not present in agent_datadog_tracked_checks] *****
fatal: [default]: FAILED! => {"msg": "'dict object' has no attribute 'filename'"}

@a-rhodes a-rhodes force-pushed the arhodes_faster_conf_check branch from a4eb5a4 to b2cd71d Compare July 17, 2024 17:25
Copy link
Contributor

@alopezz alopezz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good now and is indeed much faster. Thanks!

I do have a suggestion that could simplify the code while maintaining the enhancement, let me know what you think.

@alopezz alopezz merged commit 5225238 into DataDog:main Jul 18, 2024
120 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants