From c8ac3e46ca57e19b2d834a2235b4652040d2d954 Mon Sep 17 00:00:00 2001 From: David Ashpole Date: Wed, 23 Jul 2025 16:48:50 +0000 Subject: [PATCH] simplify target_info addition in the otlptranslator Signed-off-by: David Ashpole --- .../otlptranslator/prometheusremotewrite/helper.go | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/storage/remote/otlptranslator/prometheusremotewrite/helper.go b/storage/remote/otlptranslator/prometheusremotewrite/helper.go index ae6bb63dfb..494776ec74 100644 --- a/storage/remote/otlptranslator/prometheusremotewrite/helper.go +++ b/storage/remote/otlptranslator/prometheusremotewrite/helper.go @@ -656,12 +656,10 @@ func addResourceTargetInfo(resource pcommon.Resource, settings Settings, earlies Timestamp: timestamp.UnixMilli(), }) } - if len(ts.Samples) == 0 || ts.Samples[len(ts.Samples)-1].Timestamp < latestTimestamp.UnixMilli() { - ts.Samples = append(ts.Samples, prompb.Sample{ - Value: float64(1), - Timestamp: latestTimestamp.UnixMilli(), - }) - } + ts.Samples = append(ts.Samples, prompb.Sample{ + Value: float64(1), + Timestamp: latestTimestamp.UnixMilli(), + }) } // convertTimeStamp converts OTLP timestamp in ns to timestamp in ms.