Skip to content

Prometheus Slice - Release and Run Commands #238

Description

@josecelano

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

  1. Template Structure & Data Flow Design (1 hour)
  2. Environment Configuration (1-2 hours)
  3. Prometheus Template Renderer (2 hours)
  4. Docker Compose Integration (2-3 hours)
  5. Release Command Integration (1 hour)
  6. Ansible Deployment (1 hour)
  7. Testing & Verification (2-3 hours)
  8. Documentation (1 hour)

Specification

Full specification available at: docs/issues/prometheus-slice-release-run-commands.md

Reference Implementation

Based on torrust-demo Prometheus configuration:

Metadata

Metadata

Assignees

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions