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

Per-metrics tags

Tags can also be supplied on a per-metric basis:

@Counted(tags=[“version=v1”,”commit=abcde”])void doSomething() {  [...]}

This example defines two labels, version=v1 and commit=abcde, on the metric with the name doSomething. Those will be merged with the global tags for the output. With the preceding global tag, there would thus be three tags in the output.

In this section, we have seen how to add labels to metrics to provide additional metadata. These can be global, for all metrics exposed from a server, or application-specific, for one single metric.

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