Skip to content

Clearing/Expiration of old values in histogram/limit to histogram #245

@ported-pw

Description

@ported-pw

This is possibly more of a question and relates to metrics-util, specifically the AtomicBucket struct and it's use in metrics-exporter-prometheus.
Is there currently any intended way of being able to limit values recorded in a bucket (histogram) either by amount of time in either the type itself or the recorder? If I'm not mistaken or fundamentally misunderstanding something, currently using a Histogram would lead to a slow (or fast, depending on the rate of metrics inserted) memory leak, leading to eventual OOM of the application. Even if I clear the histogram with every snapshot, I make the memory usage dependant on an external service polling it.
What would be the best way of going about this to enable using histograms for high rates of insertions, possibly without creating a custom recorder including types to do so?

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-exporterComponent: exporters such as Prometheus, TCP, etc.E-complexEffort: complex.S-future-workStatus: valid as a potential future work item, but not currently prioritizedT-enhancementType: enhancement.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions