[8.x](backport #41449) Use optional values for docker memory metrics #41503
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Proposed commit message
Closes #40060
This deals with an issue where we were reporting docker memory
rss
metrics even though none exist under cgroups V2. This takes the easy way out by just changing the hashmaps to use option types, so we don't report0
values when none should exist.I'm not sure there's a better way to do this. As far as I can tell, there's no similar metrics in Docker's cgroups V2 reporting, and in my experience trying to be clever and derive a substitute value usually backfires for heterogeneous monitoring setups.
Checklist
CHANGELOG.next.asciidoc
orCHANGELOG-developer.next.asciidoc
.Disruptive User Impact
In cases where the docker/memory metrics were reporting an invalid
0
, they will not not report any value at all.This is an automatic backport of pull request #41449 done by [Mergify](https://mergify.com).