code: public static boolean isEnabled(Config cfg) {
      return cfg.hasPath(ConfigurationKeys.METRICS_ENABLED_KEY) ? cfg.getBoolean(ConfigurationKeys.METRICS_ENABLED_KEY)
          : Boolean.parseBoolean(ConfigurationKeys.DEFAULT_METRICS_ENABLED);
    }
docs: Check whether metrics collection and reporting are enabled or not.
  
  @param cfg a {@link State} object containing configuration properties
  @return whether metrics collection and reporting are enabled