Compare commits

...

3 Commits

Author SHA1 Message Date
Shivanth MP 6417958006
Merge 58d00f50d7 into 6a9004890f 2024-11-20 01:26:03 +08:00
Shivanth 58d00f50d7 Remove unused variable 2024-11-17 20:33:48 +01:00
Shivanth 8b1189b8a7 Add exemplars for native histograms 2024-11-17 20:29:39 +01:00
1 changed files with 3 additions and 0 deletions

View File

@ -186,6 +186,9 @@ func (m *withExemplarsMetric) Write(pb *dto.Metric) error {
case pb.Counter != nil:
pb.Counter.Exemplar = m.exemplars[len(m.exemplars)-1]
case pb.Histogram != nil:
if *pb.Histogram.Schema > math.MinInt32 {
pb.Histogram.Exemplars = append(pb.Histogram.Exemplars, m.exemplars...)
}
for _, e := range m.exemplars {
// pb.Histogram.Bucket are sorted by UpperBound.
i := sort.Search(len(pb.Histogram.Bucket), func(i int) bool {