Add metrics for the size of the diff cache in redis
We should keep track of how big the diffs are that we store in redis. That way we can add an informed application limit for those.
Follow-up from "Add redis caching of individual highlighted diffs"
The following discussion from !19917 (merged) should be addressed:
-
@reprazent started a discussion: Do we know how big this key could get?
We were already caching this in redis before, just not as efficient, so I'm fine with the change. But perhaps we should keep track of how big the cache could be getting for now, so we could add an informed limit later? I think we could add a histogram for this.
What do we need to do
-
define a new metrics for redis diff caching -
histogram for memory usage
-
-
enable gathering of metrics
Update 17 Feb 2020
I rolled out the enablement portion, however the means to gather memory usage on a single key in a redis store was introduced in 4.0.0. While we ship 5.0+, our production instances are still running redis 3.x, which lead to 500 errors. We can't complete this issue until such time as the production instances finish upgrading.
Tracking issue for the redis upgrade: https://gitlab.com/gitlab-com/gl-infra/infrastructure/issues/7392