testcontainers / testcontainers/testcontainers-python
New Container: Prometheus
Chưa có ai nhận issue này.
- Ngôn ngữ chính
- Python
- Star
- 2.3k
- Fork
- 386
- Merge trung bình
- 4 giờ 40 phút
- Pull request đã merge (30 ngày)
- 1
Mô tả
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
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Hướng nghiên cứu
Không có tệp triển khai hoặc bài kiểm thử nào được nêu tên. Hãy bắt đầu bằng cách xem xét các triển khai container hiện có của testcontainers-python cùng với tài liệu Prometheus và Docker image được liên kết; công việc được xem là hoàn tất khi một PrometheusContainer có thể cung cấp UI/API, cấu hình các scrape target hoặc một prometheus.yml tùy chỉnh, và hỗ trợ các vấn đề về readiness và tải lại cấu hình được mô tả trong issue.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- docker, prometheus, python
- Lĩnh vực
- devops, testing
- Loại issue
- Tính năng
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức độ hoạt động
- Ít trao đổi
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 45/100