Prometheus is a free, open-source systems monitoring and alerting toolkit. It is the standard for cloud-native monitoring.
What Is Prometheus?
Prometheus collects metrics from your services and stores them as time series data. Combined with Grafana, it creates a powerful monitoring stack.
Key features:
- Pull-based metrics collection
- PromQL query language
- Multi-dimensional data model
- Built-in alerting (Alertmanager)
- Service discovery
- No external dependencies
- CNCF graduated project
- Thousands of exporters available
Quick Start
docker run -d -p 9090:9090 \
-v prometheus-data:/prometheus \
prom/prometheus
Dashboard at http://localhost:9090.
Monitor Anything
Exporters available for:
- Node (Linux/system metrics)
- MySQL, PostgreSQL, MongoDB, Redis
- Nginx, Apache, Traefik
- Docker, Kubernetes
- AWS, GCP, Azure
- Custom apps (client libraries for every language)
PromQL
# CPU usage rate
rate(node_cpu_seconds_total{mode!="idle"}[5m])
# HTTP request rate
rate(http_requests_total[1m])
# 95th percentile latency
histogram_quantile(0.95, rate(http_request_duration_seconds_bucket[5m]))
Instrument Your App
from prometheus_client import Counter, Histogram, start_http_server
REQUESTS = Counter("http_requests_total", "Total requests", ["method", "path"])
LATENCY = Histogram("http_request_duration_seconds", "Request latency")
@LATENCY.time()
def handle_request(method, path):
REQUESTS.labels(method=method, path=path).inc()
# your code
start_http_server(8000) # Prometheus scrapes this
With 56K+ GitHub stars. The monitoring standard.
Monitor your scrapers! Apify tools. Custom solutions: spinov001@gmail.com
Top comments (0)