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

Accessing specific scopes

It is also possible to retrieve data for only a single scope by appending the scope name to the path. In the following example, we only retrieve metrics for the base scope:

$ curl http://localhost:8080/metrics/base

This now only shows metrics for the base scope:

# TYPE base:classloader_total_loaded_class_count counterbase:classloader_total_loaded_class_count 13973.0# TYPE base:cpu_system_load_average gaugebase:cpu_system_load_average 1.92236328125

In this section, we have seen how to retrieve metrics from a MicroProfile Metrics-enabled server. Metrics in base and vendor scopes are predefined by the server. Metrics in the application scope can be defined by the user, which we are going to explore in the next section. ...

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