Most developers know Prometheus exists. Few realize it can replace your entire $2,000/month monitoring stack — for free.
Prometheus is the second graduated CNCF project (after Kubernetes), used by Uber, SoundCloud, DigitalOcean, and thousands of production systems.
What You Get for Free
1. Pull-Based Metrics Collection
# prometheus.yml
scrape_configs:
- job_name: "my-api"
scrape_interval: 15s
static_configs:
- targets: ["localhost:3000"]
Prometheus pulls metrics from your services — no agents, no sidecars, no SDKs required.
2. PromQL — The Query Language
# Request rate per second over 5 minutes
rate(http_requests_total[5m])
# 99th percentile latency
histogram_quantile(0.99, rate(http_request_duration_seconds_bucket[5m]))
# Error rate percentage
sum(rate(http_requests_total{status=~"5.."}[5m])) / sum(rate(http_requests_total[5m])) * 100
PromQL is arguably the most powerful metrics query language ever built.
3. Client Libraries (Every Language)
const client = require("prom-client");
// Auto-collect Node.js metrics
client.collectDefaultMetrics();
// Custom business metrics
const orderCounter = new client.Counter({
name: "orders_total",
help: "Total orders processed",
labelNames: ["status", "payment_method"],
});
orderCounter.inc({ status: "completed", payment_method: "card" });
4. AlertManager (Free Alerting)
groups:
- name: api-alerts
rules:
- alert: HighErrorRate
expr: sum(rate(http_requests_total{status=~"5.."}[5m])) / sum(rate(http_requests_total[5m])) > 0.05
for: 5m
labels:
severity: critical
annotations:
summary: "Error rate above 5% for 5 minutes"
Route alerts to Slack, PagerDuty, email, or webhooks.
5. Service Discovery
Prometheus auto-discovers targets in Kubernetes, Consul, EC2, Azure, and more:
scrape_configs:
- job_name: "kubernetes-pods"
kubernetes_sd_configs:
- role: pod
relabel_configs:
- source_labels: [__meta_kubernetes_pod_annotation_prometheus_io_scrape]
action: keep
regex: true
The Free Stack
| Component | Purpose | Cost |
|---|---|---|
| Prometheus | Metrics collection & storage | Free |
| Grafana | Dashboards & visualization | Free |
| AlertManager | Alert routing | Free |
| Node Exporter | System metrics | Free |
| Blackbox Exporter | Endpoint monitoring | Free |
| Total | Full observability | $0 |
vs Paid Alternatives
Datadog charges ~$23/host/month for infrastructure monitoring. At 50 hosts, that is $1,150/month or $13,800/year.
Prometheus + Grafana on a $20/month VPS handles the same workload.
Quick Start
docker run -d -p 9090:9090 \
-v ./prometheus.yml:/etc/prometheus/prometheus.yml \
prom/prometheus
You have production-grade monitoring in 30 seconds.
Building data pipelines or need custom monitoring dashboards? I help teams set up observability stacks and data infrastructure. Email spinov001@gmail.com or explore my data tools on Apify.
Top comments (0)