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
This commit is contained in:
Julio Lopez
2023-08-03 13:27:23 -07:00
committed by GitHub
parent a9c5a993c8
commit bb7affebda

View File

@@ -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