kubernetes-sigs / usage-metrics-collector

High fidelity and scalable capacity and usage metrics for Kubernetes clusters
Apache License 2.0
118 stars 20 forks source link

Usage metrics sampler runs with high(er than expected) memory utilization. #112

Closed ichekrygin closed 10 months ago

ichekrygin commented 11 months ago

In #103 we added the initial support for the CAdvisor Network metrics sampler. As an implementation detail, we leverage advisor container stats as a stats data container:

    // CAdvisor stats.
    // Although, currently, we only collect and report network metrics,
    // we [re]use ContainerStats as a sample value holder since, in the future
    // we may choose to collect addition values (other than Network)
    CAdvisorContainerStats cadvisorv1.ContainerStats

The cadvisorv1.ContainerStats struct is a relatively large (and deep) structure. Since this field is added to a sampleInstance with high(er) cardinality (a slice of samples), we observe the overall memory increase by the sampler process.

image

dashpole commented 11 months ago

/triage accepted