Skip to content

Prometheus Slice - Release and Run Commands #238

Closed

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:

Activity

  1. self-assigned this
    on Dec 15, 2025
  2. added 20 commits that reference this issue on Dec 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions