Skip to content

Expose metrics from your applicationΒΆ

This guide will show you how to expose metrics from your application, and how to configure Prometheus to scrape them.

See further explanations on metrics for more details

1. Add metric to your applicationΒΆ

Most languages have a Prometheus client library available. See Prometheus client libraries for a list of available libraries. These libraries provides examples as to how to instrument your application using the correct metric types.

Once instrumented, your application must serve these metrics using HTTP on a given path (e.g. /metrics).

2. Enable metrics in manifestΒΆ

spec:
  prometheus:
    enabled: true
    path: /metrics

Once this manifest is deployed, Prometheus will start scraping your application for metrics on the provided path.