DEV Community

Saket
Saket

Posted on

Kubernetes - Monitor custom application metrics using Prometheus and Istio.

Kubernetes pod level metrics are captured by out of the box combination of Istio, Prometheus and Grafana components. In order to get your application metrics (e.g.: jvm metrics, custom counter metrics etc) onto Grafana, we can configure the existing setup in such a way that Istio will capture the metrics from pod and applications and merge them before sending to prometheus.

In order to do this, we need to have the application expose its metrics on some endpoint (eg: springboot provides out of the box facility to expose jvm/app metrics on actuator/prometheus api. )

Once this is setup, we can configure the deployment yaml to add annotations to the pod which help istio to scrape the metrics from the application, merge them with pod metrics and send to prometheus.

annotations:
prometheus.io/path: "/actuator/prometheus"
prometheus.io/port: "80"
prometheus.io/scheme: "http"
prometheus.io/scrape: "true"

With this setup, the application metrics will be scraped from the pod and be available along with other metrics on Grafana dashboard.

Postmark Image

Speedy emails, satisfied customers

Are delayed transactional emails costing you user satisfaction? Postmark delivers your emails almost instantly, keeping your customers happy and connected.

Sign up

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay