Add proper support for querying metrics