Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@daniel-spray
Copy link
Contributor

@daniel-spray daniel-spray commented Mar 10, 2025

What does this PR do?

(Follow up to #295)

This PR reduces memory usage and payload size of the metrics-agent by stripping unneeded metadata from Kubernetes resources by default.

This data stripping was previously done after the resources were collected and stored in memory, now the agent removes unnecessary metadata before storing the resources in the cache (reducing the memory footprint and saving agent running costs! 🎉 ).

Another payload reducing effort is included in this PR where we no longer collect Kubernetes resources that have zero cost associated with them. Such as old Completed Jobs or ReplicaSets that have 0 active pods. @jdhudson3 Thank you!

Although every Cluster's impact may vary, the results we see on our test cluster's seems to be about a 40% reduction in payload size.

Where should the reviewer start?

k8s_stats.go

How should this be manually tested?

Deployed to several testing clusters

Any background context you want to provide?

Nope
Tested with and without ParseMetricsData enabled

What picture best describes this PR (optional but encouraged)?

What are the relevant Github Issues?

Developer Done List

  • Tests Added/Updated
  • Updated README.md
  • Verified backward compatible
  • Verified database migrations will not be catastrophic
  • Considered Security, Availability and Confidentiality

For the Reviewer:

By approving this PR, the reviewer acknowledges that they have checked all items in this done list.

Reviewer/Approval Done List

  • Tests Pass Locally
  • CI Build Passes
  • Verified README.md is updated
  • Verified changes are backward compatible
  • Reviewed impact to Security, Availability and Confidentiality (if issue found, add comments and request changes)

@daniel-spray daniel-spray requested a review from bbylovas March 19, 2025 23:31
bbylovas
bbylovas previously approved these changes Mar 20, 2025
@daniel-spray daniel-spray merged commit 54ed99b into master Mar 24, 2025
3 of 4 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.

3 participants