# Prometheus Grafana

> Prometheus & Grafana Monitoring

- Skill: `j4flmao/prometheus-grafana` (Agent Skill)
- Install (CLI): `npx skillmds@latest add j4flmao/prometheus-grafana`
- Raw SKILL.md: https://api.skillmd.com/api/skills/j4flmao/prometheus-grafana/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: j4flmao (https://skillmd.com/u/j4flmao)
- Updated: 2026-09-21
- Page: https://skillmd.com/skills/j4flmao/prometheus-grafana

---

# Prometheus & Grafana Monitoring

## Core Concepts

Prometheus is the industry standard for cloud-native metrics monitoring and alerting.

### 1. The Pull Model
Prometheus actively "scrapes" (pulls) metrics from target services via HTTP endpoints (typically `/metrics`). This is the opposite of systems like StatsD which expect services to push data to them.
- Services must expose metrics in the Prometheus plaintext format using a client library.
- PromQL: A powerful functional query language used to extract time-series data.

### 2. Alertmanager & Grafana
- **Alertmanager:** Handles alerts generated by Prometheus. It deduplicates, groups, and routes them to receivers like Slack, PagerDuty, or Email.
- **Grafana:** The visualization layer. It queries Prometheus via PromQL and displays the data in rich, customizable dashboards.

### Monitoring Architecture Map

```mermaid
%%{init: {"theme": "default", "flowchart": {"useMaxWidth": true}}}%%
flowchart TD
    subgraph Targets ["Application Workloads"]
        A["Microservice 1 (/metrics)"]
        B["Microservice 2 (/metrics)"]
        C["Node Exporter (CPU/RAM)"]
    end
    
    subgraph Prom_Stack ["Prometheus Ecosystem"]
        D["Prometheus Server (TSDB)"]
        E["Alertmanager"]
    end
    
    subgraph Visualization ["Dashboards & Alerts"]
        F["Grafana (Dashboards)"]
        G["Slack / PagerDuty"]
    end
    
    D -.->|"Scrape (Pull HTTP)"| A
    D -.->|"Scrape (Pull HTTP)"| B
    D -.->|"Scrape (Pull HTTP)"| C
    
    F -->|"Query (PromQL)"| D
    D -->|"Fire Alert Rules"| E
    E -->|"Route Notifications"| G
```

