Skip to content

SendSumOfHistograms should support native histograms #6489

Open
@yeya24

Description

@yeya24

Is your feature request related to a problem? Please describe.
SendSumOfHistograms is a helper function Cortex uses to aggregate histograms from metrics registries. For example, we have certain metrics emitted from Thanos library and we aggregate them in Cortex.

data.SendSumOfHistograms(out, m.indexHeaderLoadDuration, "thanos_bucket_store_indexheader_load_duration_seconds")

With the introduction of some metrics being native histograms in Thanos, SendSumOfHistograms is not working properly as the current implementation only support legacy histograms.

See

histoBuckets := histo.GetBucket()

It ignores native histogram buckets now

	histoBuckets := histo.GetBucket()
	if len(histoBuckets) > 0 && d.buckets == nil {
		d.buckets = map[float64]uint64{}
	}

Describe the solution you'd like
Implement the sum aggregation with native histograms also

Additional context
It is unclear how would we merge legacy histograms with native histograms. Might not be a concern as we can assume in the single process it would be consistent to be either legacy or native histogram not both the same time.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions