ryantenney / metrics-spring

Spring integration for Metrics
http://www.ryantenney.com/metrics-spring/
Apache License 2.0
701 stars 226 forks source link

Configure Timed method from external file #160

Open jfcorugedo opened 8 years ago

jfcorugedo commented 8 years ago

Hi.

First of all I'd like to thank you for everything you've done in this project. The project has a great quality, with a lot of javadoc and quite good test coverage, and the code is very clean. Keep up the good work!!

On the other hand, I have a question:

I want to specify which methods must be audited in an external property/yml/xml file.

Using annotation is a really good approach, but I don't want to modify my production code every time I want to know the metrics of a particular method.

It would be great to have an external file where I can specify which methods I want to instrument, so I could modify this file in my environments (dev, qa, pre, pro) every time I want to add/remove some methods from the metrics.

Moreover, sometimes I don't have direct access to the production machines, because they are managed by a different team (even by different company too), so modifying application code to add some annotations is not an option. Instead of modifying a java file, I could tell the other team how they can enable/disable metrics of specific methods using an external file that they can put in every machine they want to instrument.

I think I could manage to do it coding my own BeanPostProcessor that reads point cuts from an external file, but I would prefer to use a build in functionality of this module.

How can I manage to do it using this project? Is there any configuration file that I can use?

Thanks!