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.
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.
- 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.
The services communicate over an isolated internal Docker bridge network (moni_network), ensuring security and reducing port exposure on the host machine.
- Docker and Docker Compose installed.
- SSL Certificates (the configuration expects a path to
/etc/letsencrypt/). - Basic understanding of YAML configuration files.
-
Clone the repository:
git clone https://github.com/FabricioLR/monitoramento cd monitoramento -
Environment Variables: Create a
.envfile in the root directory to secure your Grafana credentials:GRAFANA_ADMIN_USERNAME=admin GRAFANA_ADMIN_PASSWORD=your_secure_password
-
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.
-
Deployment:
docker-compose up -d
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.
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.
