What is Prometheus
Monitoring and alerting system
Prometheus is an open-source monitoring and alerting system designed to collect metrics from applications and infrastructure.
Key Features
- Multi-dimensional data model (labels)
- Powerful PromQL query language
- Pull-based metrics collection
- Built-in alerting
- Service discovery
Architecture
- Prometheus Server — metrics collection and storage
- Exporters — agents for exporting metrics
- Alertmanager — alert management
- Pushgateway — for short-lived jobs
- Grafana — dashboard visualization
Metric Types
- Counter — only increasing value
- Gauge — value that can go up and down
- Histogram — distribution of values
- Summary — quantiles and average
PromQL Examples
rate(http_requests_total[5m])— RPShistogram_quantile(0.95, ...)— p95 latencysum by (instance) (...)— aggregation
Integrations
- Kubernetes (kube-state-metrics)
- Node Exporter (Linux/Windows)
- MySQL, PostgreSQL, Redis
- Docker, cAdvisor