Using Prometheus to view application metrics

While you could add a job within Prometheus to include the configuration to scrape Prometheus metrics from a specific endpoint, the installation we did earlier includes a configuration that will update what it is looking at dynamically, based on annotations on pods. One of the benefits of Prometheus is that it has support for automatically detecting changes in your cluster, based on annotations, and it can look up the endpoints for the pods that back a service.

Since we deployed Prometheus using Helm, you can find the relevant configuration embedded within the values.yaml file. Look for the Prometheus job kubernetes-service-endpoints, and you will find both the configuration and some documentation ...

Get Kubernetes for Developers now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.