prometheus / prometheus/client_python

Add usage example for Celery

オープン
#902 コメント 21 件 リアクション 11 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

主要言語
Python
スター
4.4k
フォーク
876
平均マージ
8日 4時間
マージ済み PR(30日)
1

説明

I recently wanted to collect custom application metrics from a rather large Celery app. I tried several approaches with varying degrees of awkwardness, until finally settling on having a "sidecar" HTTP server process for all Celery nodes.
This works pretty well, but took me a while to get right. To spare others from wasting as much time as me, I would like to propose adding a section on getting Celery metrics set up with the Prometheus client. I wrote up the solution on StackOverflow: https://stackoverflow.com/a/75799358/2532203

If you're interested, I can properly summarise it and open a PR?

Also, if you look at the code, I needed to copy some swaths of the library because the built-in Prometheus WSGI server is hard-coded to demonise the thread; this causes trouble when running in a demonised process. Maybe this could be made optional with another keyword argument that defaults to True?

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

Issue にリンクされている StackOverflow の解決策と、exposition.py にある Prometheus クライアントの WSGI サーバーのリファレンスから始めてください。Celery worker からメトリクスを収集するための sidecar HTTP-server のセットアップを適切なドキュメントセクションにまとめ、例が完全で理解しやすいことを確認してください。既存の議論で解決されていない限り、オプションの daemon-thread の動作は別の問題として扱ってください。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
prometheus, python
領域
documentation, observability-sre
issue の種類
ドキュメント
難易度
2/5
見積もり時間
1〜3時間
活発さ
静か
明瞭さ
おおむね明確
初心者へのやさしさ
55/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。