Parent Epic: #216 (Implement ReleaseCommand and RunCommand with vertical slices)
Overview
Add Grafana as a metrics visualization service for the Torrust Tracker deployment. This extends the docker-compose stack with a Grafana service that connects to Prometheus for displaying tracker metrics through dashboards.
Key Features:
- Enabled by default in generated templates (opt-out pattern)
- Requires Prometheus to be enabled (hard dependency with validation)
- Exposes UI on port 3100 (public access until HTTPS/proxy added in roadmap task 6)
- Includes firewall configuration for port access
- Provides sample dashboards from torrust-demo as examples
Specification
Complete specification: docs/issues/grafana-slice-release-run-commands.md
Implementation Plan
Phase 1: Environment Configuration & Validation (1-2 hours)
Phase 2: Docker Compose & Firewall Integration (2-3 hours)
Phase 3: Testing & Verification (2-3 hours)
Phase 4: Documentation (1-2 hours)
Acceptance Criteria
Functional Requirements
Testing Requirements
Quality Requirements
Note for Contributors: These criteria define what the PR reviewer will check. Use this as your pre-review checklist before submitting the PR to minimize back-and-forth iterations.
Architecture
- DDD Layers: Infrastructure + Domain + Application
- New Modules:
src/domain/grafana/ - Configuration domain types
src/application/steps/configure_grafana_firewall.rs - Firewall step
src/application/command_handlers/create/config/validation/ - Dependency validation
- Templates:
configure-grafana-firewall.yml.tera, docker-compose updates
Security Notes
admin_password uses Password type from secrecy crate (automatic redaction, memory zeroing)
- Port 3100 exposure is temporary until HTTPS/reverse proxy (roadmap task 6)
- Default credentials ("admin"/"admin") must be changed in production
Related
Parent Epic: #216 (Implement ReleaseCommand and RunCommand with vertical slices)
Overview
Add Grafana as a metrics visualization service for the Torrust Tracker deployment. This extends the docker-compose stack with a Grafana service that connects to Prometheus for displaying tracker metrics through dashboards.
Key Features:
Specification
Complete specification: docs/issues/grafana-slice-release-run-commands.md
Implementation Plan
Phase 1: Environment Configuration & Validation (1-2 hours)
GrafanaConfigdomain model withPasswordtype foradmin_passwordgrafana: Option<GrafanaConfig>to environment user inputsPhase 2: Docker Compose & Firewall Integration (2-3 hours)
configure-grafana-firewall.yml)ConfigureGrafanaFirewallStepand integrate into configure commandConfigureGrafanaFirewalltoConfigureStepenumPhase 3: Testing & Verification (2-3 hours)
GrafanaValidatorwith firewall verificationPhase 4: Documentation (1-2 hours)
docs/user-guide/services/grafana/with sample dashboardsAcceptance Criteria
Functional Requirements
Testing Requirements
Quality Requirements
./scripts/pre-commit.shcargo machete)cargo test- 1500+ tests)cargo run --bin e2e-deployment-workflow-tests)Note for Contributors: These criteria define what the PR reviewer will check. Use this as your pre-review checklist before submitting the PR to minimize back-and-forth iterations.
Architecture
src/domain/grafana/- Configuration domain typessrc/application/steps/configure_grafana_firewall.rs- Firewall stepsrc/application/command_handlers/create/config/validation/- Dependency validationconfigure-grafana-firewall.yml.tera, docker-compose updatesSecurity Notes
admin_passwordusesPasswordtype from secrecy crate (automatic redaction, memory zeroing)Related