Initial vault setup
This commit is contained in:
@@ -0,0 +1,170 @@
|
||||
---
|
||||
title: Prometheus
|
||||
created: 2026-06-06
|
||||
updated: 2026-06-06
|
||||
type: app
|
||||
tags: [catalogue, monitoring, observability, time-series, kubernetes, go]
|
||||
confidence: high
|
||||
contested: false
|
||||
sources: [https://selfh.st/apps/?tag=Monitoring, https://github.com/prometheus/prometheus]
|
||||
---
|
||||
# 📊 Prometheus
|
||||
|
||||
> **Le standard industriel** pour la collecte et le stockage de métriques time-series. Indispensable pour Kubernetes et microservices.
|
||||
|
||||
## 📋 Informations Générales
|
||||
|
||||
| Champ | Valeur |
|
||||
| :--- | :--- |
|
||||
| **Site web** | [prometheus.io](https://prometheus.io/) |
|
||||
| **GitHub** | [prometheus/prometheus](https://github.com/prometheus/prometheus) |
|
||||
| **License** | Apache-2.0 |
|
||||
| **Langage** | Go |
|
||||
| **Étoiles GitHub** | 64k ⭐ |
|
||||
| **Dernière MAJ** | 2026-06-05 |
|
||||
| **Catégorie** | [[cat-monitoring|Monitoring]], Observability |
|
||||
|
||||
## 📝 Description
|
||||
|
||||
**Prometheus** est un **système de monitoring time-series** conçu pour la **fiabilité** et la **scalabilité**. Utilisé par des milliers d'entreprises.
|
||||
|
||||
**Caractéristiques** :
|
||||
- ✅ **Modèle pull** : Prometheus scrape les endpoints HTTP `/metrics`
|
||||
- ✅ **Time series database** haute performance
|
||||
- ✅ **PromQL** : langage de query puissant
|
||||
- ✅ **Alertmanager** : gestion des alertes
|
||||
- ✅ **Multi-dimensional** : labels sur les métriques
|
||||
- ✅ **Service discovery** : auto-découverte des cibles (K8s, Consul, etc.)
|
||||
- ✅ **Storage** : local (filesystem) ou remote
|
||||
- ✅ **Federation** : Prometheus qui scrape d'autres Prometheus
|
||||
|
||||
**Public cible** : **production**, microservices, Kubernetes, équipes DevOps.
|
||||
|
||||
**Inconvénient** : complexe à mettre en place, pas de GUI native (utiliser Grafana).
|
||||
|
||||
## 🚀 Installation
|
||||
|
||||
### Option 1 : Docker Compose (avec Grafana et Node Exporter)
|
||||
|
||||
```yaml
|
||||
# docker-compose.yml
|
||||
version: '3.8'
|
||||
services:
|
||||
prometheus:
|
||||
image: prom/prometheus:latest
|
||||
container_name: prometheus
|
||||
restart: unless-stopped
|
||||
volumes:
|
||||
- ./prometheus.yml:/etc/prometheus/prometheus.yml
|
||||
- prometheus-data:/prometheus
|
||||
command:
|
||||
- '--config.file=/etc/prometheus/prometheus.yml'
|
||||
- '--storage.tsdb.path=/prometheus'
|
||||
- '--web.console.libraries=/usr/share/prometheus/console_libraries'
|
||||
- '--web.console.templates=/usr/share/prometheus/consoles'
|
||||
ports:
|
||||
- "9090:9090"
|
||||
|
||||
grafana:
|
||||
image: grafana/grafana:latest
|
||||
container_name: grafana
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- "3000:3000"
|
||||
volumes:
|
||||
- grafana-data:/var/lib/grafana
|
||||
environment:
|
||||
- GF_SECURITY_ADMIN_USER=admin
|
||||
- GF_SECURITY_ADMIN_PASSWORD=***
|
||||
|
||||
node-exporter:
|
||||
image: prom/node-exporter:latest
|
||||
container_name: node-exporter
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- "9100:9100"
|
||||
volumes:
|
||||
- /proc:/host/proc:ro
|
||||
- /sys:/host/sys:ro
|
||||
- /:/rootfs:ro
|
||||
|
||||
volumes:
|
||||
prometheus-data:
|
||||
grafana-data:
|
||||
```
|
||||
|
||||
### Option 2 : Configuration (prometheus.yml)
|
||||
|
||||
```yaml
|
||||
# prometheus.yml
|
||||
global:
|
||||
scrape_interval: 15s
|
||||
|
||||
scrape_configs:
|
||||
- job_name: 'prometheus'
|
||||
static_configs:
|
||||
- targets: ['localhost:9090']
|
||||
|
||||
- job_name: 'node'
|
||||
static_configs:
|
||||
- targets: ['node-exporter:9100']
|
||||
|
||||
- job_name: 'docker'
|
||||
static_configs:
|
||||
- targets: ['cadvisor:8080']
|
||||
```
|
||||
|
||||
## ⚙️ Configuration Initiale
|
||||
|
||||
1. **Lancer la stack** (Docker Compose ci-dessus)
|
||||
2. **Accéder à Prometheus** : `http://IP:9090`
|
||||
3. **Tester une query** : `up` (retourne 1 si scrape OK, 0 sinon)
|
||||
4. **Accéder à Grafana** : `http://IP:3000` (admin/admin)
|
||||
5. **Ajouter Prometheus comme data source** : `http://prometheus:9090`
|
||||
6. **Importer un dashboard** : Dashboards > Manage > Import > ID `1860` (Node Exporter Full)
|
||||
|
||||
## 🔄 Alternatives
|
||||
|
||||
### Open Source
|
||||
- [[app-netdata]] — Pour visualisation temps réel
|
||||
- [[app-glances]] — Plus simple
|
||||
- **VictoriaMetrics** — TSDB compatible Prometheus, plus performant
|
||||
- **InfluxDB + Telegraf** — Alternative TSDB
|
||||
|
||||
### Comparaison Prometheus vs autres
|
||||
|
||||
| Critère | Prometheus | InfluxDB | VictoriaMetrics |
|
||||
| :--- | :--- | :--- | :--- |
|
||||
| Modèle | Pull | Push | Pull |
|
||||
| Query language | PromQL | InfluxQL / Flux | PromQL |
|
||||
| Ecosystem | Énorme | Grand | Compatible Prom |
|
||||
| Performance | ⭐⭐⭐⭐ | ⭐⭐⭐⭐ | ⭐⭐⭐⭐⭐ |
|
||||
| Cloud-native | ✅ | ⚠️ | ✅ |
|
||||
| Kubernetes | ✅ Standard | ⚠️ | ✅ |
|
||||
|
||||
**Verdict** : Prometheus pour le standard. VictoriaMetrics si vous avez **énormément** de métriques.
|
||||
|
||||
### Propriétaires (ce que Prometheus remplace)
|
||||
- **Datadog** ($15+/host/mois)
|
||||
- **New Relic** (cher)
|
||||
- **Dynatrace** (cher)
|
||||
- **Wavefront** (VMware, cher)
|
||||
|
||||
## 🔐 Sécurité
|
||||
|
||||
- **Auth basique** ou OAuth sur Prometheus UI
|
||||
- **TLS** pour les scrape configs
|
||||
- **Grafana** : SSO, RBAC
|
||||
- **Alertmanager** : auth + TLS
|
||||
|
||||
## 📚 Ressources
|
||||
|
||||
- [Documentation officielle](https://prometheus.io/docs/)
|
||||
- [GitHub prometheus/prometheus](https://github.com/prometheus/prometheus)
|
||||
- [Awesome Prometheus](https://github.com/roaldnefs/awesome-prometheus)
|
||||
|
||||
## Pages Liées
|
||||
- [[cat-monitoring]] — Catégorie Monitoring
|
||||
- [[app-netdata]] — Visualisation temps réel
|
||||
- [[observabilite]] — Concepts
|
||||
- [[infrastructure-as-code]] — Pour gérer la config
|
||||
Reference in New Issue
Block a user