@@ -9,13 +9,13 @@ This task adds Prometheus as a metrics collection service for the Torrust Tracke
99
1010## Goals
1111
12- - [ ] Add Prometheus service conditionally to docker-compose stack (only when present in environment config)
13- - [ ] Create Prometheus configuration template with tracker metrics endpoints
14- - [ ] Extend environment configuration schema to include Prometheus monitoring section
15- - [ ] Configure service dependency - Prometheus depends on tracker service
16- - [ ] Include Prometheus in generated environment templates by default (enabled by default)
17- - [ ] Allow users to disable Prometheus by removing its configuration section
18- - [ ] Deploy and verify Prometheus collects metrics from tracker
12+ - ✅ Add Prometheus service conditionally to docker-compose stack (only when present in environment config)
13+ - ✅ Create Prometheus configuration template with tracker metrics endpoints
14+ - ✅ Extend environment configuration schema to include Prometheus monitoring section
15+ - ✅ Configure service dependency - Prometheus depends on tracker service
16+ - ✅ Include Prometheus in generated environment templates by default (enabled by default)
17+ - ✅ Allow users to disable Prometheus by removing its configuration section
18+ - ✅ Deploy and verify Prometheus collects metrics from tracker
1919
2020## Progress
2121
@@ -125,7 +125,44 @@ This task adds Prometheus as a metrics collection service for the Torrust Tracke
125125 - All linters passing, all E2E tests passing (1507+ tests)
126126 - ** Architecture validated** : Independent service rendering pattern working correctly
127127
128- - ⏳ ** Phase 8** : Documentation (in progress)
128+ - ✅ ** Phase 8** : Documentation (commit: 2a820e2)
129+
130+ - Created ADR: ` docs/decisions/prometheus-integration-pattern.md `
131+ - Documents enabled-by-default with opt-out approach
132+ - Explains independent template rendering pattern
133+ - Documents ServiceValidation struct for extensible testing
134+ - Lists alternatives considered and consequences
135+ - Updated user guide: ` docs/user-guide/README.md `
136+ - Added Prometheus configuration section
137+ - Documents prometheus.scrape_interval parameter
138+ - Explains enabled-by-default behavior and opt-out pattern
139+ - Instructions for accessing Prometheus UI (port 9090)
140+ - Links to manual verification guide
141+ - Added technical terms to project dictionary (Alertmanager, entr, flatlined, promtool, tulpn)
142+ - All linters passing, all tests passing (1507+ tests)
143+
144+ ## Summary
145+
146+ Issue [ #238 ] ( https://github.com/torrust/torrust-tracker-deployer/issues/238 ) is ** complete** . All 8 phases implemented:
147+
148+ 1 . ✅ Template Structure & Data Flow Design
149+ 2 . ✅ Environment Configuration
150+ 3 . ✅ Prometheus Template Renderer
151+ 4 . ✅ Docker Compose Integration
152+ 5 . ✅ Release Command Integration
153+ 6 . ✅ Ansible Deployment
154+ 7 . ✅ Testing & Verification
155+ 8 . ✅ Documentation
156+
157+ ** Total Commits** : 8 (2ca0fa9, 92aab59, 731eaf4, 22790de, f20d45c, 9c1b91a, a257fcf, 2a820e2)
158+
159+ Prometheus is now fully integrated with:
160+
161+ - Metrics collection from both ` /api/v1/stats ` and ` /api/v1/metrics ` endpoints
162+ - Enabled by default with simple opt-out (remove config section)
163+ - Independent template rendering following DDD principles
164+ - Comprehensive E2E validation (automated + manual)
165+ - Complete documentation (ADR + user guide + manual verification)
129166
130167## 🏗️ Architecture Requirements
131168
@@ -141,22 +178,22 @@ This task adds Prometheus as a metrics collection service for the Torrust Tracke
141178
142179### Module Structure Requirements
143180
144- - [ ] Follow template system architecture (see [ docs/technical/template-system-architecture.md] ( ../technical/template-system-architecture.md ) )
145- - [ ] Create new Prometheus template module following existing patterns (tracker, docker-compose)
146- - [ ] Use Project Generator pattern for Prometheus templates
147- - [ ] Register Prometheus configuration template in renderer
148- - [ ] Use ` .tera ` extension for dynamic templates
149- - [ ] Environment config drives Prometheus enablement
181+ - ✅ Follow template system architecture (see [ docs/technical/template-system-architecture.md] ( ../technical/template-system-architecture.md ) )
182+ - ✅ Create new Prometheus template module following existing patterns (tracker, docker-compose)
183+ - ✅ Use Project Generator pattern for Prometheus templates
184+ - ✅ Register Prometheus configuration template in renderer
185+ - ✅ Use ` .tera ` extension for dynamic templates
186+ - ✅ Environment config drives Prometheus enablement
150187
151188### Architectural Constraints
152189
153- - [ ] Prometheus service is included by default in generated environment templates
154- - [ ] Only included in docker-compose when Prometheus section present in environment config
155- - [ ] Service can be disabled by removing the monitoring.prometheus section from config
156- - [ ] Prometheus depends on tracker service (starts after tracker container starts, no health check)
157- - [ ] Metrics API token and port read from tracker HTTP API configuration (` tracker.http_api.admin_token ` and ` tracker.http_api.bind_address ` )
158- - [ ] Prometheus configuration is dynamic (uses Tera templating)
159- - [x] ** Independent Template Rendering** : Each service renders its templates independently in the release handler
190+ - ✅ Prometheus service is included by default in generated environment templates
191+ - ✅ Only included in docker-compose when Prometheus section present in environment config
192+ - ✅ Service can be disabled by removing the monitoring.prometheus section from config
193+ - ✅ Prometheus depends on tracker service (starts after tracker container starts, no health check)
194+ - ✅ Metrics API token and port read from tracker HTTP API configuration (` tracker.http_api.admin_token ` and ` tracker.http_api.bind_address ` )
195+ - ✅ Prometheus configuration is dynamic (uses Tera templating)
196+ - ✅ ** Independent Template Rendering** : Each service renders its templates independently in the release handler
160197 - Prometheus templates rendered by dedicated ` RenderPrometheusTemplatesStep ` in release handler
161198 - Tracker templates rendered by dedicated ` RenderTrackerTemplatesStep ` in release handler
162199 - Docker Compose templates rendered by dedicated ` RenderDockerComposeTemplatesStep ` in release handler
0 commit comments