From 51e78d9a32aefc80eccdd2360a6045cbd734bdd9 Mon Sep 17 00:00:00 2001 From: Arianna Vespri Date: Wed, 20 Dec 2023 09:31:58 +0100 Subject: [PATCH] Delete debugging lines, amend error message for unit Signed-off-by: Arianna Vespri --- model/textparse/protobufparse.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/model/textparse/protobufparse.go b/model/textparse/protobufparse.go index cb622cf84..c40176bcc 100644 --- a/model/textparse/protobufparse.go +++ b/model/textparse/protobufparse.go @@ -424,15 +424,13 @@ func (p *ProtobufParser) Next() (Entry, error) { return EntryInvalid, fmt.Errorf("unknown metric type for metric %q: %s", name, p.mf.GetType()) } unit := p.mf.GetUnit() - fmt.Println("This is the unit:", unit) - fmt.Println("This is the name:", name) if len(unit) > 0 { sfx := fmt.Sprintf("_%s", unit) if p.mf.GetType() == dto.MetricType_COUNTER { sfx = fmt.Sprintf("_%s_total", unit) } if !strings.HasSuffix(name, sfx) { - return EntryInvalid, fmt.Errorf("invalid unit for metric %q: %s", name, unit) + return EntryInvalid, fmt.Errorf("unit %q not a suffix of metric %q", name, unit) } } p.metricBytes.Reset()