Adding metrics using Prometheus
As OpenTelemetry is vendor-agnostic, it provides a wide variety of support for monitoring, exporting, and collecting metrics and one option is Prometheus. A complete list of different projects supported by OpenTelemetry can be found at https://opentelemetry.io/registry/. Prometheus is an open source monitoring and alerting system server that is widely used in cloud environments; it also provides libraries for a variety of programming languages.
In the previous section, we saw how to add tracing capabilities to our application and how to retrieve the traces by using Jaeger. In this section, we are going to take a look at how to create metrics using the OpenTelemetry
library. Metrics allow us to get instrumentation information for our applications; it can provide answers to questions such as the following:
- What is the total number of requests processed in service A?
- How many total transactions are processed via payment gateway B?