Add metrics logging