testcontainers / testcontainers/testcontainers-python

New Container: Prometheus

オープン
#1,075 コメント 6 件 リアクション 0 件 担当者 0 名 GitHub で見る

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

🚀 enhancement
主要言語
Python
スター
2.3k
フォーク
386
平均マージ
4時間 40分
マージ済み PR(30日)
1

説明

Feature Request: PrometheusContainer

What is the new container you'd like to have?

I'd like to propose a PrometheusContainer for integration testing with Prometheus.

Relevant resources:

Besides exposing the Prometheus UI/API, it could provide convenience methods to configure scrape targets and rules directly, without requiring users to write and mount a complete prometheus.yml, for example:

prometheus = (
    PrometheusContainer()
    .with_scrape_target("app", app_container, port=8080, metrics_path="/metrics")
    .with_scrape_target("redis", redis_exporter)
)

The container could generate the corresponding prometheus.yml internally while still allowing users to provide a custom configuration file if needed.

Why not just use a generic container for this?

While DockerContainer("prom/prometheus") works, most tests usually need additional setup:

  • Configuring scrape targets.
  • Providing a Prometheus configuration.
  • Waiting until Prometheus is ready to accept requests.
  • Reload Prometheus on config change.
  • etc.

Other references

A similar idea has already been discussed in the testcontainers-java

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

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

はじめの一歩

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

調査の方向性

実装ファイルやテストは指定されていません。まず、既存の testcontainers-python のコンテナ実装と、リンクされている Prometheus のドキュメントおよび Docker イメージを確認してください。完了条件は、PrometheusContainer が UI/API を公開し、スクレイプターゲットまたはカスタムの prometheus.yml を設定でき、issue に記載された readiness と設定の再読み込みに関する要件をサポートできることです。

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

評価

技術スタック
docker, prometheus, python
領域
devops, testing
issue の種類
機能追加
難易度
5/5
見積もり時間
1週間以上
活発さ
静か
明瞭さ
おおむね明確
初心者へのやさしさ
45/100

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

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