August 2019
Intermediate to advanced
256 pages
6h 43m
English
Tags now also serve to distinguish metrics with the same name and type, but different tags. They could be used to support many metrics result_code on a REST endpoint to count the number of (un)successful calls:
@Inject@Metric(tags="{code,200}", name="result_code")Counter result_code_200k;@Inject@Metric(tags="{code,500}", name="result_code")Counter result_code_500;@GET@Path("/")public String getData(String someParam) { String result = getSomeData(someParam); if (result == null ) { result_code_500.inc(); } else { result_code_200.inc(); } return result;}
Under the covers, metrics are no longer only keyed by name and type, but also by their tags. For this, new MetricID has been introduced to host the name and the tags.
Read now
Unlock full access