From d495c68ef90a028fb50917c03a983a1e3b979b0a Mon Sep 17 00:00:00 2001
From: Tom Wilkie <tom.wilkie@gmail.com>
Date: Wed, 20 Mar 2019 18:41:40 +0000
Subject: [PATCH] Need to set the number of bytes read, not add them.

Signed-off-by: Tom Wilkie <tom.wilkie@gmail.com>
---
 pkg/promtail/targets/tailer.go | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pkg/promtail/targets/tailer.go b/pkg/promtail/targets/tailer.go
index 473e98b8..76da8035 100644
--- a/pkg/promtail/targets/tailer.go
+++ b/pkg/promtail/targets/tailer.go
@@ -119,7 +119,7 @@ func (t *tailer) markPosition() error {
 		return err
 	}
 
-	readBytes.WithLabelValues(t.path).Add(float64(pos))
+	readBytes.WithLabelValues(t.path).Set(float64(pos))
 	level.Debug(t.logger).Log("path", t.path, "filename", t.filename, "current_position", pos)
 	t.positions.Put(t.filename, pos)
 	return nil
-- 
GitLab