private void populateConnectionStatuses(
     final ProcessGroupStatus groupStatus, final List<ConnectionStatus> statuses) {
   statuses.addAll(groupStatus.getConnectionStatus());
   for (final ProcessGroupStatus childGroupStatus : groupStatus.getProcessGroupStatus()) {
     populateConnectionStatuses(childGroupStatus, statuses);
   }
 }
 private void populateOutputPortStatuses(
     final ProcessGroupStatus groupStatus, final List<PortStatus> statuses) {
   statuses.addAll(groupStatus.getOutputPortStatus());
   for (final ProcessGroupStatus childGroupStatus : groupStatus.getProcessGroupStatus()) {
     populateOutputPortStatuses(childGroupStatus, statuses);
   }
 }
  @Override
  public void onTrigger(ReportingContext context) {
    final ProcessGroupStatus status = context.getEventAccess().getControllerStatus();

    metricsPrefix = context.getProperty(METRICS_PREFIX).evaluateAttributeExpressions().getValue();
    environment = context.getProperty(ENVIRONMENT).evaluateAttributeExpressions().getValue();
    statusId = status.getId();
    defaultTags = ImmutableMap.of("env", environment, "dataflow_id", statusId);
    try {
      updateDataDogTransport(context);
    } catch (IOException e) {
      e.printStackTrace();
    }
    updateAllMetricGroups(status);
    ddMetricRegistryBuilder.getDatadogReporter().report();
  }