Prometheus automatic scraping is a game-changer for Kubernetes environments: it dynamically discovers metrics exporter endpoints without requiring manual configuration every time a new workload drops. But what happens when your core infrastructure relies on databases or legacy services running outside the cluster?

While this setup was natively designed for internal Kubernetes workloads, you can successfully extend automatic scraping to external servers. You do not need to abandon Kubernetes-native abstractions or hardcode static scrape targets in your Prometheus configuration.

External Services Discovery With Prometheus ServiceMonitor demonstrates how to exploit the Prometheus Operator's ServiceMonitor to dynamically discover and scrape metrics from external servers. As a practical example, we will configure a production-grade monitoring pipeline for external PostgreSQL nodes and system metrics, implementing enterprise security best practices along the way.

Read more >

When using Kubernetes, it is mandatory to collect performance metrics so as to be able to plot them into meaningful graphs (a must-have during troubleshooting), visualize alerts in dashboards and get email notification of critical events. The best practice is to deploy Prometheus, Grafana and Alertmanager.

In the "Kubernetes Prometheus And Grafana With kube-prometheus-stack" post we see how to easily deploy and setup these three amazing components to setup a full featured alerting and performance monitoring solution.

The post also shows how to deploy additional Grafana Dashboards and how to deploy custom Prometheus rules to trigger application specific alerts.

Read more >