Logo: Docker Compose Monitoring Stack

Docker Compose Monitoring Stack

Communautéit
andersonamaral2
docker-compose-monitoring-stack

Deploys a complete monitoring stack with Prometheus, Grafana, and Node Exporter using Docker Compose.

Iwwersiicht

Editeurandersonamaral2
RepositoryClaude-Code-to-Deep-Agents-Skills-Converter
Skill-Nummdocker-compose-monitoring-stack
Stären
58
Forks
8
Matgeliwwert Dateien
Nëmmen Instruktiounen
LizenzMIT
Linken
  • Instruktiounen am Markdown-Format

    Eng SKILL.md-Datei, déi de Modell bei Bedarf luet, soudatt nëmmen Token ufalen, wann eng Ufro tatsächlech dozou passt.

  • Funktionéiert mat all LLM

    KI-Skills si reng Markdown, keen ubidderspezifesche Code. Dofir funktionéiert dëse Skill mat GPT, Claude, Gemini, Grok oder engem lokale Modell.

  • Alles an den Instruktiounen

    Alles, wat de Modell brauch, steet an den Instruktiounen — keng zousätzlech Dateien ze synchroniséieren.

  • Open Source

    andersonamaral2 huet de Skill op GitHub verëffentlecht. Liest de Quelltext, ier Dir de Skill installéiert.

Installatioun

Installéiert de KI-Skill Docker Compose Monitoring Stack an TypingMind, fir e mat all LLM ze benotzen, oder setzt en an en anere KI-Agent an, deen SKILL.md liest.

1

An TypingMind installéieren

TypingMind installéiert e Skill direkt aus sengem GitHub-Dossier — dobäi gëtt SKILL.md gelies, d'Ressourcedateie gi gebëndelt an d'Resultat gëtt lokal gespäichert.

  1. Maacht d'App op a gitt op Plugins → Skills.
  2. Wielt „Vu GitHub installéieren“.
  3. Pecht d'URL vum Skill-Dossier, déi hei drënner steet, an a bestätegt d'Installatioun.
    https://github.com/andersonamaral2/Claude-Code-to-Deep-Agents-Skills-Converter/tree/main/examples/deep-agents-output-2
  4. Aktivéiert de Skill an all Chat, an deem Dir e benotze wëllt.
Plugins → Skills → Skill derbäisetzen → Iwwer eng GitHub-URL. Pecht dann d'URL vum Dossier an a klickt op Weider.
2

An engem anere KI-Agent installéieren

All KI-Agent, deen d'Format Agent Skills liest, kann dëse Skill benotzen — kopéiert den Dossier an d'Skill-Verzeechnes vun deem KI-Agent.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/andersonamaral2/Claude-Code-to-Deep-Agents-Skills-Converter.git /tmp/Claude-Code-to-Deep-Agents-Skills-Converter
mkdir -p .claude/skills
cp -r /tmp/Claude-Code-to-Deep-Agents-Skills-Converter/examples/deep-agents-output-2 .claude/skills/docker-compose-monitoring-stack
Start Claude Code nom Kopéieren nei, fir datt den neie Skill erkannt gëtt.

An TypingMind benotzen

Aktivéiert Docker Compose Monitoring Stack an engem Chat vun TypingMind, an de Modell iwwerhëlt de Rescht. Den Numm an d'Beschreiwung stinn am System-Prompt. Soubal eng Ufro dozou passt, luet de Modell déi komplett Instruktioune selwer — Dir musst de Skill ni manuell opruffen, an et fale keng Token un, bis en tatsächlech benotzt gëtt.

De Modell luet Docker Compose Monitoring Stack automatesch, soubal eng Ufro dozou passt.

Funktionéiert mat all KI-Modell

KI-Skills si reng Markdown-Instruktiounen amplaz vun ubidderspezifeschem Code. Dofir ass Docker Compose Monitoring Stack net un de Modell gebonnen, fir deen de Skill geschriwwe gouf. Installéiert en eemol an TypingMind a benotzt e mat GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama oder engem lokale Modell, deen Dir selwer bedreift — alles mat Ären eegenen API-Schlësselen.

  • Gëtt nëmme gelueden, wann et néideg ass

    De System-Prompt enthält nëmmen den Numm an d'Beschreiwung. D'Instruktioune gi bei der éischter passender Ufro gelueden, soudatt en onbenotzte Skill näischt kascht.

  • De Modell am lafende Chat wiesselen

    Well de Skill aus Instruktiounen amplaz vu Code besteet, funktionéiert en och no engem Modellwiessel — den nächste Modell liest déi selwecht SKILL.md-Datei.

Skill-Instruktiounen

Dëst ass den Inhalt vu SKILL.md, deen de Modell luet. Liest e virun der Installatioun — e Skill besteet aus Instruktiounen, déi Äre Modell befollegt.

Docker Compose Monitoring Stack

Deploys a complete monitoring stack with Prometheus, Grafana, and Node Exporter using Docker Compose.

Execution Context

This skill runs inside Deep Agents CLI (v0.0.34+). Available tools:

ToolUsage in this skill
write_fileCreate docker-compose.yml, prometheus.yml, Grafana provisioning files, .env, .gitignore
executeRun Docker Compose commands, verify services, run health checks
read_fileRead configuration files to verify content
write_todosTrack execution plan progress
http_requestTest service health endpoints

Critical execution rules:

  1. Always start by creating the plan via write_todos.
  2. Create files one by one via write_file — never try to generate everything at once.
  3. Test each service via execute immediately after starting it.
  4. Use task to delegate long or parallel subtasks to sub-agents.

Execution Plan (use with write_todos)

When receiving the request, run write_todos with:

  • 1. Verify Docker and Docker Compose are installed
  • 2. Check and set required environment variables
  • 3. Create project directory structure
  • 4. Create docker-compose.yml
  • 5. Create Prometheus configuration
  • 6. Create Grafana datasource provisioning
  • 7. Create Grafana dashboard provisioning and dashboard JSON
  • 8. Create .env and .gitignore files
  • 9. Create AGENTS.md with stack documentation
  • 10. Start the stack with Docker Compose
  • 11. Run health checks on all services

When to Use

Use this skill when the user asks to:

  • Set up monitoring or observability
  • Deploy Prometheus and Grafana
  • Create a monitoring stack
  • Set up metrics collection
  • Create a Grafana dashboard for infrastructure

Prerequisites Check

Before creating any files, use execute to verify:

bash
# Check Docker
docker --version || { echo "ERROR: Docker not found. Install from https://docs.docker.com/get-docker/"; exit 1; }

# Check Docker Compose
docker compose version || { echo "ERROR: Docker Compose not found"; exit 1; }

# Check if Docker daemon is running
docker info >/dev/null 2>&1 || { echo "ERROR: Docker daemon is not running"; exit 1; }

echo "All prerequisites OK"

If Docker is not installed, advise the user to follow the official installation guide at https://docs.docker.com/get-docker/.

Environment Setup

Before execution, verify required environment variables via execute:

bash
# Check required variables
for var in GRAFANA_ADMIN_PASSWORD; do
  if [ -z "${!var}" ]; then
    echo "ERROR: $var is not set"
    exit 1
  fi
done

# Check optional variables (with defaults)
echo "PROMETHEUS_RETENTION=${PROMETHEUS_RETENTION:-15d} (default: 15d)"

echo "All environment variables OK"

If using a .env file, load it via execute:

bash
set -a && source .env && set +a

Security note: Never hardcode secrets in the SKILL.md. Use environment variables or a .env file (added to .gitignore).

Steps

1. Create Project Structure

Use execute to create the directory structure:

bash
mkdir -p monitoring/{prometheus,grafana/provisioning/datasources,grafana/provisioning/dashboards,grafana/dashboards}

Test via execute:

bash
ls -R monitoring/ && echo "Directory structure OK"

2. Create Docker Compose File

Use write_file to create monitoring/docker-compose.yml:

yaml
version: "3.8"
services:
  prometheus:
    image: prom/prometheus:latest
    ports:
      - "9090:9090"
    volumes:
      - ./prometheus/prometheus.yml:/etc/prometheus/prometheus.yml
      - prometheus_data:/prometheus
    command:
      - '--config.file=/etc/prometheus/prometheus.yml'
      - '--storage.tsdb.retention.time=${PROMETHEUS_RETENTION:-15d}'

  grafana:
    image: grafana/grafana:latest
    ports:
      - "3000:3000"
    environment:
      - GF_SECURITY_ADMIN_PASSWORD=${GRAFANA_ADMIN_PASSWORD}
    volumes:
      - ./grafana/provisioning:/etc/grafana/provisioning
      - ./grafana/dashboards:/var/lib/grafana/dashboards
      - grafana_data:/var/lib/grafana

  node-exporter:
    image: prom/node-exporter:latest
    ports:
      - "9100:9100"
    pid: host
    volumes:
      - /proc:/host/proc:ro
      - /sys:/host/sys:ro

volumes:
  prometheus_data:
  grafana_data:

Test via execute:

bash
cd monitoring && docker compose config --quiet && echo "docker-compose.yml syntax OK"

3. Create Prometheus Configuration

Use write_file to create monitoring/prometheus/prometheus.yml:

yaml
global:
  scrape_interval: 15s

scrape_configs:
  - job_name: 'prometheus'
    static_configs:
      - targets: ['localhost:9090']

  - job_name: 'node-exporter'
    static_configs:
      - targets: ['node-exporter:9100']

4. Create Grafana Datasource Provisioning

Use write_file to create monitoring/grafana/provisioning/datasources/prometheus.yml:

yaml
apiVersion: 1
datasources:
  - name: Prometheus
    type: prometheus
    access: proxy
    url: http://prometheus:9090
    isDefault: true

5. Create Grafana Dashboard Provisioning

Use write_file to create monitoring/grafana/provisioning/dashboards/dashboards.yml:

yaml
apiVersion: 1
providers:
  - name: 'default'
    folder: ''
    type: file
    options:
      path: /var/lib/grafana/dashboards

Use write_file to create monitoring/grafana/dashboards/node-exporter.json:

Create a basic Node Exporter dashboard JSON. Use the official Grafana dashboard ID 1860 as reference.

6. Create Environment and Ignore Files

Use write_file to create monitoring/.env:

GRAFANA_ADMIN_PASSWORD=changeme
PROMETHEUS_RETENTION=15d

Use write_file to create monitoring/.gitignore:

.env
*_data/

7. Add Project Notes

Use write_file to create monitoring/AGENTS.md:

markdown
# Monitoring Stack — Project Notes

## Architecture
- **Prometheus** (port 9090): Metrics collection and storage
- **Grafana** (port 3000): Visualization and dashboards
- **Node Exporter** (port 9100): Host-level metrics

## Credentials
- Grafana login: admin / value of $GRAFANA_ADMIN_PASSWORD

## Data Persistence
- Data persists in Docker volumes even after `docker compose down`
- To fully reset: `docker compose down -v`

## Platform Notes
- On macOS, Node Exporter has limited metrics (/proc and /sys are not real Linux filesystems)
- On Linux, Node Exporter works fully

8. Start the Stack

Use execute to start all services:

bash
cd monitoring
set -a && source .env && set +a
docker compose up -d

Use execute to verify all containers are running:

bash
cd monitoring && docker compose ps

9. Run Health Checks

Platform-specific execution

Use execute to detect the platform and warn about limitations:

bash
OS=$(uname -s)
case "$OS" in
  Darwin) echo "WARNING: macOS detected — Node Exporter metrics will be limited (/proc and /sys are not real Linux filesystems)" ;;
  Linux)  echo "Linux detected — all metrics available" ;;
  *)      echo "WARNING: Unsupported OS: $OS — Node Exporter may not work correctly" ;;
esac

Use execute to test each service:

bash
echo "=== Prometheus Health ==="
curl -sf http://localhost:9090/-/healthy && echo " OK" || echo " FAILED"

echo "=== Grafana Health ==="
curl -sf http://localhost:3000/api/health && echo " OK" || echo " FAILED"

echo "=== Node Exporter Metrics ==="
curl -sf http://localhost:9100/metrics | head -5 && echo "... OK" || echo " FAILED"

echo "=== All health checks complete ==="

For each service that fails the health check, use execute to inspect logs:

bash
cd monitoring && docker compose logs <service-name>

Notes

  • Grafana default login: admin / value of $GRAFANA_ADMIN_PASSWORD
  • Prometheus UI: http://localhost:9090
  • Grafana UI: http://localhost:3000
  • Data persists in Docker volumes even after docker compose down
  • To fully reset: docker compose down -v

Usage with Deep Agents CLI

Mode 1 — Build (one-shot)

bash
deepagents -y "Deploy a monitoring stack with Prometheus and Grafana following the docker-compose-monitoring-stack skill"

Mode 2 — Interactive

bash
deepagents
> Set up a monitoring stack with Prometheus, Grafana, and Node Exporter

Mode 3 — Non-interactive (CI/CD)

bash
deepagents -n -y -S "docker,curl,mkdir" "Deploy monitoring stack with Prometheus, Grafana, and Node Exporter"

Troubleshooting

Docker not found

bash
# Check:
docker --version
# Install: follow https://docs.docker.com/get-docker/

Docker Compose not found

bash
# Check:
docker compose version
# If using older Docker, install compose plugin:
sudo apt-get install docker-compose-plugin

Docker daemon not running

bash
# Check:
docker info
# Start (Linux):
sudo systemctl start docker
# Start (macOS): open Docker Desktop app

Grafana fails health check

bash
# Check logs:
cd monitoring && docker compose logs grafana
# Verify password is set:
echo $GRAFANA_ADMIN_PASSWORD
# Restart:
docker compose restart grafana

Prometheus fails health check

bash
# Check logs:
cd monitoring && docker compose logs prometheus
# Validate config syntax:
docker run --rm -v $(pwd)/prometheus:/etc/prometheus prom/prometheus promtool check config /etc/prometheus/prometheus.yml

Node Exporter metrics incomplete on macOS

This is expected. On macOS, /proc and /sys are not real Linux filesystems,
so Node Exporter cannot collect full host metrics. For full metrics,
deploy on a Linux host or use Docker Desktop's VM metrics.

Environment variable not set

bash
# Check what's set:
env | grep -E "GRAFANA|PROMETHEUS"
# Set manually:
export GRAFANA_ADMIN_PASSWORD="your-secure-password"
export PROMETHEUS_RETENTION="15d"
# Or load from .env:
set -a && source .env && set +a

Context window overflow

Use /compact to force compaction before continuing.
Consider splitting the task with `task` sub-agents.

Heefeg gestallte Froen

Wat mécht de KI-Skill Docker Compose Monitoring Stack?

Deploys a complete monitoring stack with Prometheus, Grafana, and Node Exporter using Docker Compose.

Firwat Docker Compose Monitoring Stack op TypingMind benotzen?

Well Dir en eemol installéiert a mat all Modell benotze kënnt. Docker Compose Monitoring Stack besteet aus einfachem Markdown amplaz vun ubidderspezifeschem Code. Dee selwechte Skill funktionéiert also mat GPT-5, Claude, Gemini, Grok oder engem lokale Modell – an Dir kënnt de Modell matzen am Chat wiesselen, ouni datt de Skill ophält ze funktionéieren. TypingMind benotzt Är eegen API-Schlësselen, sou datt Dir d'Ubidder direkt bezuelt, amplaz en Abonnement pro Benotzerplaz ze bezuelen. Är Skills a Chats bleiwen an Ärem eegene Späicher.

Wéi installéieren ech Docker Compose Monitoring Stack an TypingMind?

Maacht an TypingMind Plugins → Skills → Vu GitHub installéieren op a setzt https://github.com/andersonamaral2/Claude-Code-to-Deep-Agents-Skills-Converter/tree/main/examples/deep-agents-output-2 an. TypingMind liest d'Datei SKILL.md an installéiert de Skill, deen Dir pro Chat aktivéiere kënnt.

Wéi eng KI-Modeller kënnen Docker Compose Monitoring Stack benotzen?

All Modell, deen Dir an TypingMind verbënnt. KI-Skills sinn einfach Markdown-Instruktiounen an net ubidderspezifesche Code. Dofir kënne GPT, Claude, Gemini, Grok a lokal Modeller dëse Skill lueden, wann eng Ufro dozou passt.

Wéi vill KI-Modeller kann ech mat Docker Compose Monitoring Stack benotzen?

Esou vill wéi Dir wëllt. Soulaang e Modell Skills ënnerstëtzt, kënnt Dir Docker Compose Monitoring Stack domat benotzen – zum Beispill mat GPT, Claude, Gemini, Grok, DeepSeek, Mistral oder Llama – alles op TypingMind mat Ären eegenen API-Schlësselen.

Ass de KI-Skill Docker Compose Monitoring Stack gratis?

Jo. andersonamaral2 huet de Skill ënner der Lizenz MIT op GitHub publizéiert. Dir bezuelt nëmmen Ären eegene KI-Ubidder fir d'Token, déi Dir benotzt.

Wat si KI-Skills?

E KI-Skill ass e weiderverwendbare Pak vun Instruktiounen, deen engem KI-Modell bäibréngt, wéi en eng bestëmmt Aufgab erfëllt. E follegt dem oppenen Agent Skills-Format: eng Datei SKILL.md mat engem Numm an enger Beschreiwung, plus all Scripten, Virlagen oder Referenzdateien, déi de Modell eventuell brauch. De Modell liest d'Instruktiounen eréischt, wann Är Ufro zum Skill passt. En installéierte Skill kascht also näischt, bis e benotzt gëtt.

Wéi ënnerscheede sech KI-Skills vu Plugins oder MCP-Serveren?

E Plugin oder MCP-Server gëtt engem Modell nei Tools, déi en opruffe kann – Code, deen iergendwou leeft an e Resultat zeréckgëtt. E KI-Skill gëtt dem Modell dogéint Wëssen an eng Virgoensweis: wéi en eng Aufgab ugeet, wéi eng Schrëtt e maache soll a wéi eng gutt Ausgab ausgesäit. Skills bestinn aus einfachem Markdown, brauche kee Server, keen API-Schlëssel a kee Lafzäitëmfeld a funktionéiere mat all Modell.

Alleguer weisen

Elo Ären eegene KI-Aarbechtsberäich ariichten

Abonnéiert Iech op eisen Newsletter, fir iwwer nei Funktiounen an zukünfteg Gewënnspiller informéiert ze ginn 👇