From bb7affebda99f566857b333d77b47568eaf5fc3a Mon Sep 17 00:00:00 2001 From: Julio Lopez <1953782+julio-lopez@users.noreply.github.com> Date: Thu, 3 Aug 2023 13:27:23 -0700 Subject: [PATCH] fix(general): change cache full logging frequency & message (#3193) fix(general): change cache full logging frequency to once every 10 minutes Addresses concerns about too many messages in the logs (#3085) fix(general): avoid logging cache key. Instead log the cache description, which provides information about the types of contents being cached. Followups to #3085 --- internal/cache/persistent_lru_cache.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/cache/persistent_lru_cache.go b/internal/cache/persistent_lru_cache.go index eea9164af..c56b2261b 100644 --- a/internal/cache/persistent_lru_cache.go +++ b/internal/cache/persistent_lru_cache.go @@ -233,10 +233,10 @@ func (c *PersistentCache) Put(ctx context.Context, key string, data gather.Bytes // snapshots/restores from getting affected by the cache's storage use. if c.isCacheFullLocked() { // Limit warnings to one per minute max. - if clock.Now().Sub(c.lastCacheWarning) > time.Minute { + if clock.Now().Sub(c.lastCacheWarning) > 10*time.Minute { c.lastCacheWarning = clock.Now() - log(ctx).Warnf("Cache is full, unable to add %v into cache.", key) + log(ctx).Warnf("Cache is full, unable to add item into '%s' cache.", c.description) } return