I want to record counts for multiple metric names like metricA, metricB, metricC so on and so forth. One option is to create multiple counter objects like this
Counter
.builder("metricA")
.register(registry);
However, this is going to lead to a lot of objects which I am not OK with.
I was wondering if there is a way to use the same counter object and record counts for multiple metrics.
Is there a way to create counter and then create tags on the fly fetching the same counter object and increment on those tags separately ?
The idea is to use the plot the same metric (meter) in the monitoring tool and have the separation around the tags in the same graph.
Or if there is a way to create a Counter meter with lets say 10 tags and increment a tag at a time ?