From 8381e036ac2a84719a04ad4e47a732f9e8ed4aba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gy=C3=B6rgy=20Krajcsovits?= Date: Mon, 7 Jul 2025 10:33:18 +0200 Subject: [PATCH] [chore][receiver/prometheus]: remove workaround for Prom issue 16217 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Upstream has the fix for https://github.com/prometheus/prometheus/issues/16217 I didn't remember if I had a test for this, so reverted to 929f5f9593c6ad56e187dc69bdd881f14b22f58a before Bump prometheus to 0.304.1 (#40397) There tests fail without the fix in TestNativeVsClassicHistogramScrapeViaProtobuf/feature_disabled_scrape_classic_on/target1/target1 (re-run 1) (0.00s) metrics_receiver_protobuf_test.go:312: Error: Not equal: expected: 1 actual : 3 Now tests don't fail without the workaround anymore. Signed-off-by: György Krajcsovits --- receiver/prometheusreceiver/internal/transaction.go | 6 ------ 1 file changed, 6 deletions(-) diff --git a/receiver/prometheusreceiver/internal/transaction.go b/receiver/prometheusreceiver/internal/transaction.go index 6e027d64eb890..41f7b371213f4 100644 --- a/receiver/prometheusreceiver/internal/transaction.go +++ b/receiver/prometheusreceiver/internal/transaction.go @@ -278,12 +278,6 @@ func (t *transaction) AppendExemplar(_ storage.SeriesRef, l labels.Labels, e exe } mf := t.getOrCreateMetricFamily(*rKey, getScopeID(l), mn) - - // Workaround for https://github.com/prometheus/prometheus/issues/16217 - if !t.enableNativeHistograms && mf.mtype == pmetric.MetricTypeHistogram && l.Get(model.MetricNameLabel) == mf.name { - return 0, nil - } - mf.addExemplar(t.getSeriesRef(l, mf.mtype), e) return 0, nil