Here is the patch to add per-measurement level filtering of metrics.

Here is a patch that adds measurement level filtering of metrics. Most of the heavy lifting was done in a fork of the Metrics 2.2.0 release. Here is the diff of that fork: https://github.com/mspiegel/metrics/compare/codahale:v2.2.0...v2.2.0-measurement-filter.

I've added to the README file in metrics-reporter-config an example that uses the measurement predicate:

    ganglia:
      -
        period: 60
        timeunit: 'SECONDS'
        gmondConf: '/etc/ganglia/gmond.conf'
        predicate:
          color: "black"
          patterns:
          - ".*JMXONLY$"
          histogram:
              color: "white"
              patterns:
              - metric: ".*WidgetRunner$"
                measure: "[mean|stddev]"
              - metric: ".*SprocketRunner$"
                measure: ".*percentile"

This patch will compile with both the forked and unforked versions of metrics library. It overrides the method MetricPredicate#matches(MetricName name, Metric metric, String measurement) that exists only in the forked version. In metrics-reporter-config I did not add the @Override annotation to allow for compilation in either case.

Question: should I push to the maven central repository an artifact named com.yammer.metrics.metrics-core with a version number of 2.2.0-measurement-filter and then change the metrics-reporter-config pom.xml to use that version as a dependency?