Parent Epic: #216 (Implement ReleaseCommand and RunCommand with vertical slices)
Overview
This task adds Prometheus as a metrics collection service for the Torrust Tracker deployment. It extends the docker-compose stack with a Prometheus service that scrapes metrics and stats from the tracker's HTTP API. The service is enabled by default in generated environment templates, but can be disabled by removing the Prometheus configuration section from the environment config file.
Goals
- Add Prometheus service conditionally to docker-compose stack (only when present in environment config)
- Create Prometheus configuration template with tracker metrics endpoints
- Extend environment configuration schema to include Prometheus monitoring section
- Configure service dependency - Prometheus depends on tracker service
- Include Prometheus in generated environment templates by default (enabled by default)
- Allow users to disable Prometheus by removing its configuration section
- Deploy and verify Prometheus collects metrics from tracker
Key Details
- DDD Layers: Infrastructure + Domain
- New Module:
src/infrastructure/templating/prometheus/
- Pattern: Template System with Project Generator pattern
- Approach: Enabled-by-default, opt-out (remove config section to disable)
- Time Estimate: 13-17 hours
Implementation Phases
- Template Structure & Data Flow Design (1 hour)
- Environment Configuration (1-2 hours)
- Prometheus Template Renderer (2 hours)
- Docker Compose Integration (2-3 hours)
- Release Command Integration (1 hour)
- Ansible Deployment (1 hour)
- Testing & Verification (2-3 hours)
- Documentation (1 hour)
Specification
Full specification available at: docs/issues/prometheus-slice-release-run-commands.md
Reference Implementation
Based on torrust-demo Prometheus configuration:
Parent Epic: #216 (Implement ReleaseCommand and RunCommand with vertical slices)
Overview
This task adds Prometheus as a metrics collection service for the Torrust Tracker deployment. It extends the docker-compose stack with a Prometheus service that scrapes metrics and stats from the tracker's HTTP API. The service is enabled by default in generated environment templates, but can be disabled by removing the Prometheus configuration section from the environment config file.
Goals
Key Details
src/infrastructure/templating/prometheus/Implementation Phases
Specification
Full specification available at:
docs/issues/prometheus-slice-release-run-commands.mdReference Implementation
Based on torrust-demo Prometheus configuration: