logzio/jmx2graphite

Can you filter metrics taken from jolokia?

Closed this issue · 2 comments

Hello,
Seems like the jmx2graphite take all metrics and sends them to graphite. I am using jolokia to expose jmx from Cassandra clusters which finds around 4097 metric beans which translates to 15011 metrics per minute sent to my graphite cluster. It depletes the disk space in the graphite cluster really fast.
Is there a way in which I can specify what metric beans to be queried? I only want specific metrics to be sent to my graphite cluster not all of them.
Thank you

asafm commented

Hi @dancb10 - I'm sorry but adding the option of white listing is a feature on roadmap which we haven't gotten around to do yet.

You are more than welcome to submit a pull request. It breakdown to:

  • Adding an optional configuration option called whiteList, which contain an array of regular expressions, based on Pattern regex language.
  • in MetricsPipeline.java, in poll(), after polling and getting the metric values (List<MetricValue>), filtering them, allowing only name which matches against one of the regular expressions.
    ** Not forgetting to log how many were removed and how many remained.
  • Exposing the option twice
    ** One for Java Agent flavour: look at Jmx2GraphiteJavaAgent
    ** One for Docker flavour through application.conf

Merged at #57