From ccd86002cfaca77cd4308e2510f3084753ab47ec Mon Sep 17 00:00:00 2001 From: Cedric Den Haese Date: Mon, 8 Jul 2019 09:21:08 +0100 Subject: [PATCH] Fix TTL bug lastRegistredAt element was only set at creation of a time series. Now it is updated every time a new event is seen for that time series. Signed-off-by: Cedric Den Haese --- registry.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/registry.go b/registry.go index 64a58b3d..df16dee2 100644 --- a/registry.go +++ b/registry.go @@ -169,6 +169,8 @@ func (r *registry) get(metricName string, hash labelHash, metricType metricType) rm, ok := metric.metrics[hash.values] if ok { + now := clock.Now() + rm.lastRegisteredAt = now return metric.vectors[hash.names].holder, rm.metric }