How can i override the addQuery() method in Metric tab?

Hi
In my plugin development, I need do some works after a new metric added, How can i do that? Is there override concept or like this?