O'Reilly logo

Hands-On Enterprise Java Microservices with Eclipse MicroProfile by Scott Stark, Antoine Sabot-Durand, Pavol Loffay, Jeff Mesnil, Heiko W. Rupp, Cesar Saavedra

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Using Prometheus to retrieve metrics

Now that we have seen what metrics are exposed and how we can define our own, let's have a look at how we can collect them in a time series database (TSDB). For this purpose, we use Prometheus, a CNCF (https://www.cncf.io/) project that has gained widespread adoption in the cloud-native world.

You can download Prometheus from https://prometheus.io or on macOS via brew install prometheus.

Once Prometheus is downloaded, we need a configuration file that defines which targets to scrape and can then start the server. For our purposes, we will use the following simple file:

.Prometheus configuration for a Thorntail Server, prom.ymlscrape_configs:# Configuration to poll from Thorntail- job_name: 'thorntail' ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required