code: public static String getOutputMetric(MonitoringRule rule) {
          String paramName = METRIC_PARAM_NAME;
  
          for (Action action : rule.getActions().getActions()) {
              if (OUTPUT_METRIC_ACTION.equalsIgnoreCase(action.getName())) {
                  Parameter param = getActionParameter(action, paramName);
                  return param.getValue();
              }
          }
          return "";
      }
docs: Get the first OutputMetric name of a rule (i.e., the name of stream to
  subscribe to) if defined; empty string otherwise.