https://github.com/aanttrax/observability
This repository sets up a full observability environment for Docker Compose services, using: Prometheus: Metric collection, Grafana: Visualization of metrics and logs, cAdvisor: Monitoring of Docker containers, Node Exporter: Monitoring of the host system, Loki: Log storage, Promtail: Log collection from containers
https://github.com/aanttrax/observability
cadvisor devops docker-compose grafana loki node-exporter observability prometheus promtail
Last synced: 10 months ago
JSON representation
This repository sets up a full observability environment for Docker Compose services, using: Prometheus: Metric collection, Grafana: Visualization of metrics and logs, cAdvisor: Monitoring of Docker containers, Node Exporter: Monitoring of the host system, Loki: Log storage, Promtail: Log collection from containers
- Host: GitHub
- URL: https://github.com/aanttrax/observability
- Owner: Aanttrax
- Created: 2025-04-24T11:29:31.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2025-04-26T23:43:34.000Z (10 months ago)
- Last Synced: 2025-04-30T01:09:44.078Z (10 months ago)
- Topics: cadvisor, devops, docker-compose, grafana, loki, node-exporter, observability, prometheus, promtail
- Homepage:
- Size: 4.88 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# ๐ Docker Observability Stack
This repository sets up a full **observability** environment for Docker Compose services, using:
- **Prometheus**: Metric collection.
- **Grafana**: Visualization of metrics and logs.
- **cAdvisor**: Monitoring of Docker containers.
- **Node Exporter**: Monitoring of the host system.
- **Loki**: Log storage.
- **Promtail**: Log collection from containers.
- **Nginx**: Service to expose to a master nginx.
---
## ๐ Technologies Used
| Component | Description |
|:-----------|:------------|
| **Prometheus** | Scrapes metrics from containers and the host system. |
| **Grafana** | Dashboard for visualizing metrics and logs. |
| **cAdvisor** | Metrics for each container (CPU, RAM, Disk, Network). |
| **Node Exporter** | Metrics for the host OS (CPU, RAM, Disk, Network). |
| **Loki** | Log database. |
| **Promtail** | Log collector for Loki. |
| **Nginx** | Service to expose to a master nginx. |
---
## ๐ ๏ธ How to Run the Stack
1. Clone the repository:
```bash
git clone https://github.com/Aanttrax/observability.git
cd observability
```
2. Create the `.env` file for Grafana credentials:
```bash
echo "GF_SECURITY_ADMIN_USER=admin" >> .env
echo "GF_SECURITY_ADMIN_PASSWORD=admin" >> .env
```
(Modify values for enhanced security)
3. Launch the services:
```bash
docker-compose up -d
```
4. Access Grafana:
- URL: [http://localhost:3000](http://localhost:3000)
- Username: `admin`
- Password: `admin` (or whatever you set in `.env`)
---
## ๐ Repository Structure
```plaintext
โโโ docker-compose.yml
โโโ prometheus.yml
โโโ grafana.ini
โโโ loki-config.yml
โโโ promtail-config.yml
โโโ observability.conf
โโโ README.md
```
---
## ๐ฅ Exposed Services
| Service | Access URL |
|:-----------------|:----------------------------|
| **Grafana** | [http://localhost:3000](http://localhost:3000) |
---
## ๐ Recommended Dashboards
- Node Exporter Full (by Prometheus)
- Docker Containers Metrics (by cAdvisor)
- Loki Logs Explorer (by Loki)
- Prometheus Metrics Overview
*(You can import these dashboards directly in Grafana using their ID from Grafana.com or by uploading the JSON files.)*
---
## ๐ง Important Notes
- **cAdvisor** automatically detects all running containers.
- **Promtail** collects logs from `/var/log/containers/` automatically.
- This stack is **not production-ready** (e.g., Grafana without HTTPS). Use it only in controlled environments.
---
## ๐งน To Clean Up
```bash
docker-compose down -v
```
*(This removes containers, networks, and volumes.)*
---
# โจ Author
> Stack created by Aanttrax โ inspired by modern observability practices.