Custom Metrics
Prometheus provides client libraries for many languages, such as Go, Java, and Python, to expose custom metrics that can be read by the Prometheus server. You need to create a /metrics
endpoint from your application for Prometheus to read the custom metrics. Additionally, for the Prometheus server to discover your application, you need to add this annotation to your pod: prometheus.io/scrape
: true
.
Here is how it will look in the pod definition:
metadata: annotations: prometheus.io/scrape: "true"
These custom metrics can be categorized under APM. They can be anything that would be valuable for you to monitor for the application. For example, for a financial institution, the number of transactions can be really valuable, whereas, for a messaging application, the number of messages in the queue can be much more valuable. After determining the needs of the application, you can use the appropriate client library for your application to expose the...