Observability Stack
Complete observability setup with Prometheus, Loki, Tempo, and Grafana.
Quick Start```bash
Start stack
docker compose up -d
Start app
npm install
node server.js
Access Grafana: `http://localhost:3001` (admin/admin)
## Components
- **Prometheus** - Metrics
- **Loki** - Logs
- **Tempo** - Traces
- **Grafana** - Visualization
- **Grafana MCP** - AI integration
## Ports
| Service | Port |
|---------|------|
| Node.js | 3000 |
| Grafana | 3001 |
| Prometheus | 9090 |
| Loki | 3100 |
| Tempo | 3200 |
## Usage
**Generate data:**```bash
curl -X POST http://localhost:3000/execute \
-H "Content-Type: application/json" \
-d '{"type":"db","mode":"fail"}'
Types: db, general | Modes: success, slow, fail
Metrics:```bash
curl http://localhost:3000/metrics
## Grafana MCP
Query Grafana via AI using Model Context Protocol.
**Setup:**
1. Create service token in Grafana (http://localhost:3001)
2. Add to `.env`: `GRAFANA_SERVICE_TOKEN=glsa_YOUR_TOKEN`
3. Add to `.vscode/settings.json`:```json
{
"github.copilot.chat.mcp.servers": {
"grafana": {
"command": "docker",
"args": ["exec", "-i", "grafana-mcp", "/app/mcp-grafana", "-t", "stdio"]
}
}
}
```
4. Restart VSCode
**Usage in VSCode Copilot Chat:**
- Type `/mcp` to see available servers
- "List my Grafana dashboards"
- "Query Prometheus for error rates"
See GRAFANA_MCP_SETUP.md for details.
## Docs
- OBSERVABILITY_SETUP.md - Full setup guide
- GRAFANA_MCP_SETUP.md - MCP configuration
## Troubleshooting```bash
# Check service status
docker compose ps
# View logs
docker compose logs -f grafana
# Verify targets
curl http://localhost:9090/targets
# Reset (deletes data)
docker compose down -v && docker compose up -d
Example Use (Copilot + Grafana MCP)
Below are real examples of how Grafana MCP can be used to interact with observability data.
Example Questions
- “List all available Grafana dashboards”
- “Show error rate metrics for the last 15 minutes”
- “Find logs related to database failures”
- “Correlate traces with high latency and errors”
- “Create a dashboard for service error trends”
Demo
Create a dashboard using the mcp:
https://github.com/user-attachments/assets/a5aa584c-d4a4-4a54-b6c5-b61b46e6eac4
