DEV Community

Alex Spinov
Alex Spinov

Posted on

Prometheus Has a Free Monitoring Stack That Scales to Millions of Metrics

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"]
Enter fullscreen mode Exit fullscreen mode

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
Enter fullscreen mode Exit fullscreen mode

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" });
Enter fullscreen mode Exit fullscreen mode

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"
Enter fullscreen mode Exit fullscreen mode

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
Enter fullscreen mode Exit fullscreen mode

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
Enter fullscreen mode Exit fullscreen mode

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)