Last Updated: November 21, 2025
Prometheus
Open-source monitoring and alerting
Core Components
| Item | Description |
|---|---|
Prometheus Server
|
Scrapes and stores time-series data |
Exporter
|
Exposes metrics from services |
Pushgateway
|
Allows pushing metrics |
Alertmanager
|
Handles alerts |
PromQL
|
Query language for metrics |
Configuration Example
global:
scrape_interval: 15s
evaluation_interval: 15s
scrape_configs:
- job_name: 'my-app'
static_configs:
- targets: ['localhost:9090']
- job_name: 'node-exporter'
static_configs:
- targets: ['localhost:9100']
Common PromQL Queries
| Item | Description |
|---|---|
rate(http_requests_total[5m])
|
Request rate over 5 minutes |
avg(cpu_usage)
|
Average CPU usage |
sum by (job) (requests)
|
Sum requests by job |
histogram_quantile(0.95, rate(...))
|
95th percentile latency |
Best Practices
- Use labels for multi-dimensional data
- Set appropriate scrape intervals
- Use recording rules for expensive queries
- Configure retention policies for data
💡 Pro Tips
Quick Reference
Use Grafana for visualizing Prometheus metrics