A robust and flexible Prometheus + Loki + Grafana (PLG) stack for monitoring and log aggregation. This setup is designed to be easily adaptable to any project by simply changing the log path in the .env file. Integrated with MinIO for scalable object storage of logs.
- 🐳 Docker Compose - Container orchestration
- 📈 Prometheus - Monitoring and alerting toolkit
- 📊 Grafana - Analytics & monitoring dashboards
- 📝 Loki - Log aggregation system
- 📦 MinIO - S3-compatible object storage for logs
- Dynamic Configuration: Environment variables are used for flexibility, allowing easy adaptation across projects.
- Integrated MinIO: MinIO acts as S3-compatible object storage for Loki's log data, ensuring scalable log retention.
- Templated Dashboards: Pre-configured dashboards for visualizing metrics and logs in Grafana.
- Scalable & Resilient: Prometheus and Loki configurations allow for long-term monitoring and logging capabilities.
git clone https://github.com/Firas-Ruine/plg-stack
cd plg-stackCopy the .env.development to .env and customize it according to your project:
cp .env.development .env- Update the
LOG_PATHto the location where your logs are stored. - Customize
GRAFANA_ADMIN_USER,PROMETHEUS_JOB_NAME, andMINIO_ACCESS_KEYas needed.
Run the following command to spin up the PLG stack with MinIO:
docker-compose up -d| Service | URL | Default Credentials |
|---|---|---|
| Prometheus | http://localhost:9090 | N/A |
| Loki | http://localhost:3100 | N/A |
| Grafana | http://localhost:3000 | admin / admin (or as set in .env) |
| MinIO | http://localhost:9000 | minio / minio123 (or as set in .env) |
- Open MinIO UI.
- Log in using the credentials from
.env. - Create a new bucket named
loki-bucket(or the bucket name you set in.env).
To use this setup with any project, simply update the LOG_PATH in the .env file:
LOG_PATH=/new/project/logsTo monitor new services with Prometheus, update the PROMETHEUS_TARGET in .env:
PROMETHEUS_TARGET=your-service:portControl how long logs are kept by adjusting LOKI_RETENTION in .env:
LOKI_RETENTION=240h # 10 days retention- Grafana comes pre-configured with data sources for Prometheus and Loki. You can easily create dashboards to visualize your metrics and logs.
- Explore and import community dashboards for various use cases.
- Prometheus Remote Storage: Integrate with remote storage solutions like Thanos for scalable and long-term metric storage.
- Loki with MinIO: Loki is configured to store logs in MinIO for persistent log storage across environments.
- Alerting: Configure alerts in Prometheus or Grafana for proactive monitoring of your services.
- Modify default credentials for Grafana and MinIO in the
.envfile. - Set up SSL/TLS for secure communication between services.
Feel free to submit issues, fork this repository, and open pull requests with new features or improvements!
Made with ❤️ by Firas Ruine