testcontainers / testcontainers/testcontainers-python
New Container: Prometheus
Nessuno ha ancora preso questa issue.
- Lingua principale
- Python
- Stelle
- 2.3k
- Fork
- 386
- Merge medio
- 4h 40m
- PR unite (30g)
- 1
Descrizione
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:
- Docker image: https://hub.docker.com/r/prom/prometheus
- Prometheus docs: https://prometheus.io/docs/introduction/overview/
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
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Non sono indicati file di implementazione né test. Inizia esaminando le implementazioni dei container esistenti di testcontainers-python e la documentazione di Prometheus e l’immagine Docker collegate; il lavoro è completo quando un PrometheusContainer può esporre la UI/API, configurare target di scrape o un prometheus.yml personalizzato e supportare gli aspetti di readiness e ricaricamento della configurazione descritti nell’issue.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- docker, prometheus, python
- Ambito
- devops, testing
- Tipo di issue
- Funzionalità
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Stato di attività
- Tranquilla
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 45/100