ASGI mounted to FastAPI mounts metrics to `/metrics/` instead of `/metrics`
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 35/100
調査の方向性
リンクされたドキュメントの FastAPI の例から始め、uvicorn を使ってマウントされた /metrics リクエストを再現します。リダイレクトが、ドキュメントに記載された client_python の例によって制御されているのか、FastAPI のマウント動作によって制御されているのかを確認します。完了条件は、リダイレクトを回避するか、実際のエンドポイントの動作を明確に文書化することです。
索引モデルが issue の本文から書いたものです。
説明
The documentation gives an example application which mounts the ASGI app to /metrics in a FastAPI app
from fastapi import FastAPI
from prometheus_client import make_asgi_app
# Create app
app = FastAPI(debug=False)
# Add prometheus asgi middleware to route /metrics requests
metrics_app = make_asgi_app()
app.mount("/metrics", metrics_app)
and says that you should be able to see the metrics at http://localhost:8000/metrics, however if you try to access this endpoint
$ uvicorn app:app
INFO: Started server process [1620866]
INFO: Waiting for application startup.
INFO: Application startup complete.
INFO: Uvicorn running on http://127.0.0.1:8000 (Press CTRL+C to quit)
INFO: 127.0.0.1:34428 - "GET / HTTP/1.1" 404 Not Found
INFO: 127.0.0.1:34428 - "GET /favicon.ico HTTP/1.1" 404 Not Found
INFO: 127.0.0.1:34444 - "GET /metrics HTTP/1.1" 307 Temporary Redirect
INFO: 127.0.0.1:34444 - "GET /metrics/ HTTP/1.1" 200 OK
you get redirected to /metrics/.
It would be better if this redirect could be avoided.
- 主要言語
- Python
- スター
- 4.4k
- フォーク
- 876
- 平均マージ
- 8日 4時間
- マージ済み PR(30日)
- 1
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
prometheus/client_python のほかの issue
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
prometheus/client_python#1177 · コメント 1 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 58/100
prometheus/client_python#1199 · リアクション 1 件 ·
-
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
prometheus/client_python#1176 ·
-
難易度 1/5 1〜3時間 初心者へのやさしさ 52/100
prometheus/client_python#1126 · コメント 2 件 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
prometheus/client_python#1123 ·
prometheus/client_python の issue をすべて見る
似ている issue
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 90/100
learningequality/ricecooker#747 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
BSData/horus-heresy-3rd-edition#3171 ·
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
run-llama/llama_index#23199 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
KhronosGroup/glTF-Blender-IO#2769 ·