datadog-agent
datadog-agent copied to clipboard
Remove legacy container metrics collection code
What does this PR do?
Clean up old metrics collection code: most of the code was unused since migration to v2, two other components were still calling the old containers package:
- Hostname resolution for the UTS mode check: the check has been moved to use UTS NS inode identifier, which will be more reliable and work everywhere (not only Docker)
- ECS v1 was using
GetDefaultGatewayin an attempt to find ECS Agent IP, this code has been migrated to theutil/systempackage.
Motivation
Cleanup
Additional Notes
Possible Drawbacks / Trade-offs
Describe how to test/QA your changes
There's nothing specific to QA, but we want to make sure key features that were historically using containers package still work, namely:
- ECS Linux & Windows
- Docker
- Hostname resolution on Docker without Docker socket mounted and
--uts host - Hostname resolution on Kubernetes without Kubelet access and without CRI socket mounted
Reviewer's Checklist
- [x] If known, an appropriate milestone has been selected; otherwise the
Triagemilestone is set. - [x] Use the
major_changelabel 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. - [x] A release note has been added or the
changelog/no-changeloglabel has been applied. - [x] Changed code has automated tests for its functionality.
- [x] Adequate QA/testing plan information is provided if the
qa/skip-qalabel is not applied. - [x] At least one
team/..label has been applied, indicating the team(s) that should QA this change. - [x] If applicable, docs team has been notified or an issue has been opened on the documentation repo.
- [x] If applicable, the
need-change/operatorandneed-change/helmlabels have been applied. - [x] If applicable, the
k8s/<min-version>label, indicating the lowest Kubernetes version compatible with this feature. - [x] If applicable, the config template has been updated.