Open keisku opened 4 days ago
Use this command from test-infra-definitions to manually test this PR changes on a VM:
inv create-vm --pipeline-id=37916077 --os-family=ubuntu
Note: This applies to commit 0638897b
Run ID: 4a11ee24-34cb-4cc5-b4f6-39008a1504ac Metrics dashboard Target profiles
Baseline: 1248ec4f0bece8d46a33f20ff1447c7de7be6706 Comparison: 0638897b4cada159e588c26120ac6dba7c20a2a4
Performance changes are noted in the perf column of each table:
Confidence level: 90.00% Effect size tolerance: |Δ mean %| ≥ 5.00%
There were no significant changes in experiment optimization goals at this confidence level and effect size tolerance.
What does this PR do?
Use cache when
workloadmeta-kube_metadata
gets namespace metadata.Motivation
CONS-6403
Improving the
kubemetadata.(*collector).parsePods()
performance.Currently, when
workloadmeta-kube_metadata
parses 100 Pods, the implementation results in 100 communications with the DCA to retrieve namespace metadata. Since the namespace metadata is the same for multiple Pods, there is no need to communicate with the DCA for each Pod.https://github.com/DataDog/datadog-agent/blob/1248ec4f0bece8d46a33f20ff1447c7de7be6706/comp/core/workloadmeta/collectors/internal/kubemetadata/kubemetadata.go#L210-L293
Additional Notes
DD_KUBERNETES_METADATA_TAG_UPDATE_FREQ
(= 60s by default).https://github.com/DataDog/datadog-agent/blob/1cf1cce4b5711e0929b4eca8d3fd1c51cf3b8a4c/pkg/config/setup/config.go#L1499
https://github.com/DataDog/datadog-agent/blob/a9f51824ae913c875c8c39f187aa91b124b99de2/pkg/util/clusteragent/clusteragent.go#L405-L417
Possible Drawbacks / Trade-offs
Describe how to test/QA your changes