Interview Prep/Monitoring & Observability/Observability as Code, Security & Vendor Choices

What NetworkPolicies do you apply to the monitoring namespace?

IntermediateProductionObservability as Code, Security & Vendor Choices
Answer

Default deny ingress, then allow only what is needed:

  • Grafana from the ingress controller.
  • Prometheus (9090) from Grafana, Thanos Query or the Mimir ruler, and from itself for HA.
  • Alertmanager (9093) from Prometheus; cluster gossip (9094 TCP/UDP) between Alertmanager peers.
  • Loki and Tempo writes from the agents' namespace only.

Egress also matters: Prometheus must reach every scrape target, so application namespaces with default-deny need an ingress rule allowing the monitoring namespace on the metrics port. Forgetting that is a common cause of targets going DOWN with context deadline exceeded after a security hardening sprint.

All Monitoring & Observability questions

More on Observability as Code, Security & Vendor Choices