Docker/Containers: Memory Metric Updates

New memory metrics have been added in nri-docker 1.6.0 (to be released as part of infrastructure agent 1.17.0).
Additionally, as part of this release we changed the way we calculate memoryUsageBytes and memoryUsageLimitPercent.

Learn more about the new memory and storage metrics added in the release notes and product documentation.

What’s changing?
Swap memory has been removed from memoryUsageBytes and memoryUsageLimitPercent.
As a side-effect of this change, memoryUsageLimitPercent now reports the expected value and fixes the issue where value could be greater than 100%.

This is how the metrics will be calculated starting with nri-docker 1.6.0:

  • memorySwapLimitUsagePercent = memorySwapUsageBytes / memorySwapLimitBytes
  • memoryUsageLimitPercent = memoryUsageBytes / memorySizeLimitBytes

For reference:

  • Metrics with no swap reference in the name have no swap components.
  • Metrics with swap reference have memory+swap unless the contrary is specified like in memorySwapOnlyUsageBytes.

Given memoryUsageBytes was implemented as memory + swap but the memoryUsageLimitPercent was calculated as percent related to memory limit, then, memoryUsageLimitPercent could end with values greater than 100%.

We recommend alert conditions based on any of these two metrics to be reviewed and adjusted as needed.

  • Alerts based on memoryUsageBytes needs to be reviewed, metric will now exclude swap memory so the condition limit needs to be re-evaluated and adjusted as needed.

  • Alerts based on memoryUsageLimitPercent metric were alerting on the wrong value. No action is needed except from revisiting the alert configuration and adjust if necessary.

1 Like