An open API service indexing awesome lists of open source software.

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

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.