I'm using the default MicroMeter binders, one of them creating the Gauage jvm.memory.used
. The issue is that it comes with 2 availableTags: "area" and "id". This is practically generating 6 Gauges which I'm not interested in.
I was able to do this:
@Bean
public MeterRegistryCustomizer<MeterRegistry> metricsCustomizer() {
return registry -> {
registry.config().meterFilter(MeterFilter.ignoreTags("id"));
};
}
but this will ignore all meters with this tag.
How can I deny()
only jvm.memory.used
with an id
tag?
Thanks!
EDIT:
Looking at the globalRegistry:
Metrics.globalRegistry.getRegistries().iterator().next().meterMap
Every Meter
of jvm.memory.used
is of the following structure:
"MeterId{name='jvm.memory.used', tags=[tag(area=nonheap),tag(id=Metaspace)]}"
So we can't just filter by getName().equals("jvm.memory.used") && getTag("id") != null