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

Server-wide tags

Server-wide tags are set via the environment variable, MP_METRICS_TAGS, as shown:

export MP_METRICS_TAGS=app=myShopjava -jar target/metrics-thorntail.jar

These tags will be added to all metrics defined in the server and also added to the respective output format.

So, given the preceding command, a counter, @Counted(absolute=true) int myCount;, would end up in Prometheus as follows:

# TYPE application:my_count counterapplication:my_count{app="myShop"} 0

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