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

disk check – fix excluded_disks and excluded_filesystems #13954

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

tristanpemble
Copy link

@tristanpemble tristanpemble commented Oct 19, 2022

What does this PR do?

fixes #12676 so that the config values are properly read.

Motivation

excluded_disks and excluded_filesystems are ignored in the disk check. this makes it impossible to shut the datadog-agent up when you're running it alongside a Docker daemon:

datadog-agent[741351]: {"agent":"core","time":"2022-10-19 21:37:45 UTC","level":"WARN","file":"pkg/collector/corechecks/system/disk/disk_nix.go","line":"69","func":"collectPartitionMetrics","msg":"Unable to get disk metrics of /run/docker/netns/dc7cd87fb085 mount point: permission denied"}
datadog-agent[741351]: {"agent":"core","time":"2022-10-19 21:37:45 UTC","level":"WARN","file":"pkg/collector/corechecks/system/disk/disk_nix.go","line":"69","func":"collectPartitionMetrics","msg":"Unable to get disk metrics of /var/lib/docker/overlay2/5e665e6efd833cf145533eae8d17c8133bc418a46e14fe362a665698b6530312/merged mount point: permission denied"}
datadog-agent[741351]: {"agent":"core","time":"2022-10-19 21:38:00 UTC","level":"WARN","file":"pkg/collector/corechecks/system/disk/disk_nix.go","line":"69","func":"collectPartitionMetrics","msg":"Unable to get disk metrics of /var/lib/docker/overlay2/0aa531af6b93c0ee052da4819f6fb09109bfae5d2033b5c04020e00f30ff05c8/merged mount point: permission denied"}
datadog-agent[741351]: {"agent":"core","time":"2022-10-19 21:38:00 UTC","level":"WARN","file":"pkg/collector/corechecks/system/disk/disk_nix.go","line":"69","func":"collectPartitionMetrics","msg":"Unable to get disk metrics of /var/lib/docker/overlay2/b5e42024c90dcc6628ab2efd479cd0d550643a94ce1b4e859b1838156625496a/merged mount point: permission denied"}
datadog-agent[741351]: {"agent":"core","time":"2022-10-19 21:38:00 UTC","level":"WARN","file":"pkg/collector/corechecks/system/disk/disk_nix.go","line":"69","func":"collectPartitionMetrics","msg":"Unable to get disk metrics of /var/lib/docker/overlay2/afddbb4089d7507c927e3318bda3eb81d5cd29dee4b284c0a5e30d2eb3cfbb41/merged mount point: permission denied"}

Additional Notes

casting []interface{} to []string does not work; so this conditional fails silently. the result is that these config values do not work.

Possible Drawbacks / Trade-offs

Describe how to test/QA your changes

Reviewer's Checklist

  • If known, an appropriate milestone has been selected; otherwise the Triage milestone is set.
  • Use the major_change label if your change either has a major impact on the code base, is impacting multiple teams or is changing important well-established internals of the Agent. This label will be use during QA to make sure each team pay extra attention to the changed behavior. For any customer facing change use a releasenote.
  • A release note has been added or the changelog/no-changelog label has been applied.
  • Changed code has automated tests for its functionality.
  • Adequate QA/testing plan information is provided if the qa/skip-qa label is not applied.
  • At least one team/.. label has been applied, indicating the team(s) that should QA this change.
  • If applicable, docs team has been notified or an issue has been opened on the documentation repo.
  • If applicable, the need-change/operator and need-change/helm labels have been applied.
  • If applicable, the k8s/<min-version> label, indicating the lowest Kubernetes version compatible with this feature.
  • If applicable, the config template has been updated.

@tristanpemble tristanpemble requested a review from a team as a code owner October 19, 2022 21:40
@bits-bot
Copy link
Collaborator

bits-bot commented Oct 19, 2022

CLA assistant check
All committers have signed the CLA.

@mikecook
Copy link

mikecook commented Nov 3, 2022

Bump for reviewer

@amenasria
Copy link
Contributor

👋 Hey @tristanpemble, sorry for the late reply. Thanks a lot for your PR !

Lot of work right now, our team will review it ASAP.

Could you please provide your /etc/datadog-agent/conf.d/disk.d/conf.yaml config file (not the one in #12676 but the one before your blacklists configuration tests) ? That would help us faster review your PR !

@tristanpemble
Copy link
Author

👋 Hey @tristanpemble, sorry for the late reply. Thanks a lot for your PR !

Lot of work right now, our team will review it ASAP.

Could you please provide your /etc/datadog-agent/conf.d/disk.d/conf.yaml config file (not the one in #12676 but the one before your blacklists configuration tests) ? That would help us faster review your PR !

unfortunately, I have since left the company I was at when I filed this PR, so I cannot do this

@amenasria amenasria requested review from a team and removed request for a team November 27, 2023 12:40
@RoseSecurity
Copy link

Any updates on this?

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.

pkg/collector/corechecks/system/disk/disk_nix.go spam in newer version of agents
5 participants