From af4505c18f995d338877a3433a01947cf4cbc7be Mon Sep 17 00:00:00 2001 From: Heathcliff Date: Sat, 4 Jan 2025 11:35:21 +0100 Subject: [PATCH] Fix panic when using untyped metrics Signed-off-by: Heathcliff --- promremote/client.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/promremote/client.go b/promremote/client.go index 59c6c5e..6813e9c 100644 --- a/promremote/client.go +++ b/promremote/client.go @@ -166,9 +166,9 @@ func (c *Client) collect() ([]prompb.TimeSeries, error) { } else if m.Gauge != nil { value = m.Gauge.GetValue() } else if m.Untyped != nil { - value = m.Counter.GetValue() + value = m.Untyped.GetValue() } else { - return nil, fmt.Errorf("Unknown metric type") + return nil, fmt.Errorf("unknown metric type") } ts.Samples = []prompb.Sample{ {