Skip to content

FabricioLR/Monitoring-Stack

Repository files navigation

Observability Stack: Prometheus, Loki, & Grafana

This repository contains a production-ready Docker Compose deployment for a comprehensive monitoring and observability stack. It is designed to provide real-time insights into system health, container performance, and application logs.

🚀 Overview

The stack integrates the industry-standard "LGTM" (Loki, Grafana, Tempo, Mimir) philosophy—specifically focusing on metrics and logs—to ensure high visibility across your infrastructure.

Core Components

  • Visualization: Grafana for dashboards and alerting.
  • Metrics Collection: Prometheus for time-series data.
  • Logging: Loki & Promtail for log aggregation.
  • Infrastructure Exporters:
    • Node Exporter: Host-level hardware and OS metrics.
    • cAdvisor: Real-time resource usage and performance characteristics of running containers.
    • Process Exporter: Detailed mining of process-specific resident memory and CPU usage.
  • Alerting: Alertmanager for handling silenced, grouped, and routed notifications.

🛠️ Architecture

The services communicate over an isolated internal Docker bridge network (moni_network), ensuring security and reducing port exposure on the host machine.


📋 Prerequisites

  • Docker and Docker Compose installed.
  • SSL Certificates (the configuration expects a path to /etc/letsencrypt/).
  • Basic understanding of YAML configuration files.

⚙️ Configuration & Setup

  1. Clone the repository:

    git clone https://github.com/FabricioLR/monitoramento
    cd monitoramento
  2. Environment Variables: Create a .env file in the root directory to secure your Grafana credentials:

    GRAFANA_ADMIN_USERNAME=admin
    GRAFANA_ADMIN_PASSWORD=your_secure_password
  3. Required Config Files: Ensure the following configuration files exist in the project root:

    • grafana.ini: Grafana system settings.
    • prometheus.yml: Scrape configurations and targets.
    • promtail-config.yml: Log scraping and shipping logic.
    • alertmanager.yml: Alert routing and notification channels.
    • process-config.yml: Logic for the process-exporter to group your services.
  4. Deployment:

    docker-compose up -d

🌐 Accessing the Stack

Once the containers are healthy, you can access the web interfaces via the following ports:

Service Port Description
Grafana 3000 Main dashboard UI
Prometheus 9090 Expression browser and target status

Note: Alertmanager works with N8N to send alerts.


🛡️ Security Note

This setup includes a volume mapping for SSL certificates from Let's Encrypt. Ensure that the paths in the volumes section of the grafana service match your server's certificate directory structure to enable HTTPS.


📸 Preview

Dashboard Preview

About

Monitoring and observability stack using Grafana and Prometheus

Topics

Resources

Stars

Watchers

Forks