prometheus / jmx_exporter

A process for exposing JMX Beans via HTTP for Prometheus consumption
Apache License 2.0
3.06k stars 1.2k forks source link

Question about excludeObjectNames #904

Open bianchi2 opened 10 months ago

bianchi2 commented 10 months ago

What would be the right syntax to exclude metrics by category? Say, I want to exclude all metrics where category00=:hazelcast". Example metrics:

com_example_MeanRate{category00="hazelcast",category01="distributedObject",name="created",tag_objectName="example-cache.Cache.com.example.previews.jwt.JwtUsageLogFilter",tag_serviceName="hz_impl_mapService",}

com_example_95thPercentile{category00="hazelcast",category01="distributedObject",name="created",tag_objectName="example-cache.Cache.com.example.previews.jwt.JwtUsageLogFilter",tag_serviceName="hz_impl_mapService",}
dhoard commented 10 months ago

@bianchi2 excludeObjectNames is a regex match on the MBean object name.

Looking at...

com_example_MeanRate{category00="hazelcast",category01="distributedObject",name="created",tag_objectName="example-cache.Cache.com.example.previews.jwt.JwtUsageLogFilter",tag_serviceName="hz_impl_mapService",}

This seems odd/wrong to me... it seems to indicate you have an MBean named MeanRate?

bianchi2 commented 10 months ago

@dhoard this is how metrics show up. Yes, it look like that would be the bean name. Hundreds of metrics are under com_example_MeanRate, and they differ by categories only.

dhoard commented 10 months ago

@bianchi2 which version of the exporter are you using?