prometheus / prometheus/client_python
Lack of PID uniqueness in container environments makes prometheus_multiproc difficult to use
まだ誰も着手していません。
- 主要言語
- Python
- スター
- 4.4k
- フォーク
- 876
- 平均マージ
- 8日 4時間
- マージ済み PR(30日)
- 1
説明
In environments where each container is running in its own PID namespace, multiple instances of the same container will quickly result in (silently) conflicting file names as any my-favorite-server.py process will likely have the same low, single or double digit PID in each of the multiple containers. As a result, the different processes will attempt to mmap the same file in the shared multiprocess metric directory, and various scary errors that aren't always easy to understand the root cause will occur.
It would be beneficial if something in addition to the PID was used to help ensure uniqueness across the files in the PROMETHEUS_MULTIPROC_DIR, or if a string could be passed in at initialization time to be embedded in the file names, such as a container or pod name, or another value determined by the application.
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
まず、prometheus_multiproc が PROMETHEUS_MULTIPROC_DIR 内のファイルにどのような名前を付け、プロセス ID からどのように名前を導出しているかを追跡します。複数のコンテナがディレクトリを共有する場合の動作を比較し、その後、issue に適した一意性のメカニズムまたは初期化値を決定します。同時実行中のコンテナプロセスが mmap で競合するファイルを使用しなくなり、関連する失敗ケースがテストでカバーされれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- prometheus, python
- 領域
- observability
- issue の種類
- 機能追加
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 38/100