code: private static TagList getMonitorTags(Object obj) {
      try {
        Set<Field> fields = getFieldsAnnotatedBy(obj.getClass(), MonitorTags.class);
        for (Field field : fields) {
          field.setAccessible(true);
          return (TagList) field.get(obj);
        }
  
        Set<Method> methods = getMethodsAnnotatedBy(obj.getClass(), MonitorTags.class);
        for (Method method : methods) {
          method.setAccessible(true);
          return (TagList) method.invoke(obj);
        }
      } catch (Exception e) {
        throw Throwables.propagate(e);
      }
  
      return null;
    }
docs: Get tags from annotation.