← All insightsIntegration

How to use Istio with Prometheus

CodeWizard Academy · 26 April 2025 · 3 min read · Intermediate

Istio and Prometheus are a common pairing in a modern DevOps stack. Here is how they fit together and a practical way to wire them up.

Where Istio fits

Istio is a service mesh that injects sidecar (or ambient) proxies to give you mutual TLS, fine-grained traffic routing, retries, and rich telemetry across services - configured with Kubernetes CRDs.

yaml
apiVersion: networking.istio.io/v1
kind: VirtualService
metadata: { name: web }
spec:
  hosts: [web]
  http:
    - route:
        - destination: { host: web, subset: v1 }
          weight: 90
        - destination: { host: web, subset: v2 }
          weight: 10

Where Prometheus fits

Prometheus scrapes metrics from HTTP endpoints, stores them as time series, and lets you query and alert on them with PromQL - the backbone of Kubernetes-era monitoring.

yaml
# prometheus.yml
scrape_configs:
  - job_name: app
    static_configs: [{ targets: ['app:3000'] }]
---
# rules.yml
groups:
  - name: app
    rules:
      - alert: HighErrorRate
        expr: rate(http_requests_total{status=~"5.."}[5m]) > 0.05
        for: 10m
        labels: { severity: page }
        annotations: { summary: "5xx error rate above 5%" }

Making them work together

  • Start with mTLS and telemetry; add traffic rules only when needed
  • Use istioctl analyze in CI to catch misconfigurations
  • Keep label cardinality low and stable
  • Alert on symptoms (latency, error ratio) via SLOs, not noisy causes

Want this pairing set up properly, with docs and handover? That is exactly the kind of work CodeWizard's embedded senior engineers do - and both Istio and Prometheus have active community groups you can join for free.

Like where this is going?

Get hands-on help from the engineers who write these posts.

Book a free consult