Improvement on the plugin to make metrics configurable