Introduce a new metric for calculating memory usage percentage
- Dominant language
- Python
- Stars
- 5.1k
- Forks
- 796
- PR merge metrics
- No merged PRs in 30d
Description
Currently, all GRR server components expose two [Prometheus](https://prometheus.io/) metrics which are related to memory usage: `process_virtual_memory_bytes` (Virtual memory size in bytes) and `process_resident_memory_bytes` (Resident memory size in bytes). Both metrics are implemented as [Gauges](https://prometheus.io/docs/concepts/metric_types/#gauge), and are exposed by the [Prometheus client library in GRR](https://github.com/google/grr/blob/b2969c7ed6f5c6e62919fa66625d992e7b5e0b34/grr/server/grr_response_server/prometheus_stats_collector.py#L12). Further explanation of these two metrics can be found in the official documentation of [writing client libraries for Prometheus](https://prometheus.io/docs/instrumenting/writing_clientlibs/#process-metrics).
We suggest introducing a new metric, such as current memory used in bytes, that will allow calculating and graphing memory usage percentage. Using this metric, we can create a relevant graph, which can be implemented as part of the [grr_grafanalib_dashboards](https://github.com/google/grr/tree/master/monitoring/grafana) module and inserted into the existing sample dashboards for GRR servers.
Moreover, such a metric can be used for calculations other than memory usage percentage; ideas are welcome!
Contributor guide
Assessment
This issue has not been assessed yet.