node-mixin: Adjust `memory used` Dashboard to use `MemAvailable`
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 75/100
- issue の種類
- リファクタリング
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- linux, prometheus
調査の方向性
この issue は、特定のファイル docs/node-mixin/lib/prom-mixin.libsonnet の 126-137 行目と、ルールファイル docs/node-mixin/rules/rules.libsonnet を指しています。まず、現在のメモリ使用量ダッシュボードの計算式と、すでに MemAvailable を使用している既存のメモリ使用率ルールを調べてください。タスクは、ダッシュボードの計算式を更新して、互換性のために古い計算にフォールバックする MemAvailable を使用することです。JSONnet ミキシンの構造を確認し、Prometheus クエリがどのように構築されているかを理解することで、変更を検証してください。
索引モデルが issue の本文から書いたものです。
説明
Currently, the memory used dashboard in the node-mixin for Linux uses the formula
\text{memory used} = \text{MemTotal} - \text{MemFree} - \text{Buffers} - \text{Cached}
The Linux kernel introduced MemAvailable specifically because the formula above is a less accurate estimation of usable memory. As a result, a more accurate number for memory usage would be
\text{memory used} = \text{MemTotal} - \text{MemAvailable}
We encouraged gopsutil to adopt the same formula to calculate usage and psutil adopted it at coincidentally the same time (but independent of our gopsutil suggestion).
I see that the memory utilization dashboard already accounts for this: https://github.com/prometheus/node_exporter/blob/125a02099cde708ee9c99fddcc29a2703e92c576/docs/node-mixin/rules/rules.libsonnet#L43-L58
Should the memory used dashboard do the same thing? I assume if it did something like this:
node_memory_MemTotal_bytes{%(nodeExporterSelector)s} - (
node_memory_MemAvailable_bytes{%(nodeExporterSelector)s}
or
(
node_memory_Buffers_bytes{%(nodeExporterSelector)s}
+
node_memory_Cached_bytes{%(nodeExporterSelector)s}
+
node_memory_MemFree_bytes{%(nodeExporterSelector)s}
)
)
That would make it so users on Linux environments that don't provide MemAvailable wouldn't be broken, but the rest could get a more accurate value that is similar to the calculation already being done in the utilization dashboard.
P.S. The way free used to calculated this in the past also included SReclaimable as part of the calculation alongside Cached, Buffers, and MemFree, and gopsutil used to do the same thing. I'm unsure whether it's worth it at this point to mess with the existing approximation formula in the dashboard, but I figured I would bring it up.
- 主要言語
- Go
- スター
- 13.8k
- フォーク
- 2.7k
- 平均マージ
- 1日 4時間
- マージ済み PR(30日)
- 7
環境構築
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
prometheus/node_exporter のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
prometheus/node_exporter#3823 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
prometheus/node_exporter#3817 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
prometheus/node_exporter#3761 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 68/100
prometheus/node_exporter#1767 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
prometheus/node_exporter#3826 ·
メンテナーはふだん 1 日以内に返信
prometheus/node_exporter の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
gruntwork-io/boilerplate#329 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
prime-radiant-inc/evener#3291 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
Netcracker/qubership-apihub-backend#582 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
メンテナーはふだん 1 日以内に返信