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

Retrieving metrics from the server

MicroProfile Metrics exposes metrics via a REST interface, by default, under the /metrics context root. You can find the code at https://github.com/PacktPublishing/Hands-On-Enterprise-Java-Microservices-with-Eclipse-MicroProfile/tree/master/Chapter05-metrics. Follow the README.md file to build the code, run it, and hit the http://localhost:8080/book-metrics/hello and http://localhost:8080/book-metrics endpoints a few times with your browser to generate some data.

As of MicroProfile 1.3/2.0, there is nothing in the specifications about securing that endpoint. This is thus left to the individual implementation.

Using this REST interface, it is easy to retrieve the data, for example, via the following curl ...

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