The Simplest Way to Make Cilium and Prometheus Work Like They Should
Running cilium and prometheus together gives your team clear network metrics across your cluster. Cilium tracks packet flow in the kernel, and Prometheus pulls those stats on a schedule. This pair lets you watch dropped packets, policy hits, and service latency in one place. Platform teams use this setup to spot network drops before users notice an outage. How data flows between cilium and prometheus Cilium runs an agent on every node in your cluster to manage network rules. Each agent can op
Your coding agents run with your access.
Claude Code reaches prod with a developer's credentials, and approval prompts get clicked through. hoop.dev checks every query, masks sensitive data, and holds risky changes for a human.
Running cilium and prometheus together gives your team clear network metrics across your cluster. Cilium tracks packet flow in the kernel, and Prometheus pulls those stats on a schedule. This pair lets you watch dropped packets, policy hits, and service latency in one place. Platform teams use this setup to spot network drops before users notice an outage.
How data flows between cilium and prometheus
Cilium runs an agent on every node in your cluster to manage network rules. Each agent can open a local port that serves metrics in a plain text format. Beyond the node agent, the central operator and flow relay also expose their own health stats. Prometheus uses cluster service discovery to find every node agent and operator pod.
Once Prometheus finds those pods, it sends an HTTP read request on a fixed timer. The Cilium agent answers with current counters for packet drops, policy rules, and proxy latency. You must set up service discovery roles so Prometheus can list pods across namespaces. The collector only needs read rights on pod metadata and network endpoints to do its job.
Many teams also turn on flow metrics to see traffic between specific app groups. You can pick which labels to include so your metric store does not grow too fast. When you keep label counts low, Prometheus reads and stores the data without memory spikes. Good label rules keep dashboards fast and help engineers find broken services in seconds.
Common failure modes and how to scope network paths
A common mistake is opening metrics ports to every pod on the cluster network. When any pod can read node agent stats, attackers can map your internal services. Another big issue is using a single broad cluster role for the metric collector. If someone steals that broad token, they can read secrets or change cluster state.
Teams also run into trouble when they turn on every flow label at once. High label counts create millions of unique metric series that crash the Prometheus storage engine. Unlogged queries to the metric server also make it hard to track who viewed sensitive traffic data. Also, strict network rules can block the collector from reaching the node agents at all.
End-to-End Encryption + Cilium Network Policies: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
To fix these risks, lock down the network path between the two tools first. Write a network rule that only lets the Prometheus pod reach the Cilium metric ports. Give the collector a small role that only lists pods and reads metric endpoints. Never share that service account with other monitoring apps or build scripts in your cluster.
Keeping metric collection fast and safe at scale
Large clusters need careful tuning so metric scrapes do not slow down the control plane. Start by turning on only the metric groups that your alert rules actually check. Drop high cardinality labels like source pod IP before the collector writes them to disk. Review your metric lists each month to remove unused series that waste memory and disk space.
You should also encrypt the traffic between the collector and the node agents. Mutual TLS makes sure only the real Prometheus server can read network flow counters. Rotate those TLS keys on a set schedule to keep the scrape path safe. Clear role boundaries and tight network rules make this pair safe for production workloads.
Add runtime guardrails and masking beside your databases and APIs
Login rules, role grants, and CI checks govern who connects to your stack. Yet any allowed script, engineer, or AI agent still runs commands with the full scope of its role. For workloads on Postgres, MySQL, SQL Server, MongoDB, ClickHouse, Kubernetes, SSH, or internal HTTP services, hoop.dev sits beside the service as an open-source proxy, a sidecar for your database or API.
Before a query runs, hoop.dev guardrails check the statement against your rules. An AI Analyzer you configure can score intent or hold risky calls for human review. Next, hoop.dev data masking rewrites sensitive fields in responses, and each verdict is logged per listener. Explore the MIT-licensed project on GitHub.
Frequently asked questions
Why is Prometheus missing metrics from Cilium agents?
The metrics port on the Cilium agent or operator is likely turned off by default. You must enable the metrics port in your setup and allow scrape traffic in network rules.
How do I stop Cilium flow metrics from filling up Prometheus storage?
Limit the labels attached to flow metrics so you do not track single pod IPs. Group traffic by namespace or app name instead to keep the total series count low.
What permissions does Prometheus need to scrape Cilium pods?
Prometheus needs a read-only cluster role that can list nodes, pods, and service endpoints. Pair this role with a network rule that permits ingress to the agent metrics port.
Related guides
In this post