<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Re: Custom reporting task not triggering in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Custom-reporting-task-not-triggering/m-p/209193#M79210</link>
    <description>&lt;P&gt;Your getLogger.info(...) statement is inside a for loop over "statuses" and I don't see a variable called statuses so it is hard to say what is in the variable, but if that is an empty collection then you might not be executing your for loop. I would try putting a logging statement right at the beginning of onTrigger to see if the reporting task is even executed.&lt;/P&gt;</description>
    <pubDate>Wed, 06 Jun 2018 02:05:44 GMT</pubDate>
    <dc:creator>bbende</dc:creator>
    <dc:date>2018-06-06T02:05:44Z</dc:date>
    <item>
      <title>Custom reporting task not triggering</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Custom-reporting-task-not-triggering/m-p/209192#M79209</link>
      <description>&lt;P&gt;I have implemented a custom reporting task, very simple one to start with, which just logs all details that come in the context of `onTrigger` method. I see the nar being unpacked and the reporting task being started when I start from the settings, but nothing logs after that.&lt;/P&gt;&lt;P&gt;My Run Schedule is 30 sec (I also tried changing this to 1 mins and 5 mins), but nothing ever logs, but reporting task shows as running. No errors in logs whatsoever.&lt;/P&gt;&lt;P&gt;Only log lines I see in nifi-app.log are these&lt;/P&gt;&lt;PRE&gt;org.apache.nifi.metrics.reporting.task.MetricsReportingTask
                org.apache.nifi:nifi-metrics-reporting-nar:1.6.0-SNAPSHOT || ./work/nar/extensions/nifi-metrics-reporting-nar-1.6.0-SNAPSHOT.nar-unpacked
        org.apache.nifi.reporting.ambari.AmbariReportingTask
                org.apache.nifi:nifi-ambari-nar:1.6.0-SNAPSHOT || ./work/nar/extensions/nifi-ambari-nar-1.6.0-SNAPSHOT.nar-unpacked
        org.apache.nifi.reporting.datadog.DataDogReportingTask
                org.apache.nifi:nifi-datadog-nar:1.6.0-SNAPSHOT || ./work/nar/extensions/nifi-datadog-nar-1.6.0-SNAPSHOT.nar-unpacked
        org.apache.nifi.controller.ControllerStatusReportingTask
                org.apache.nifi:nifi-standard-nar:1.6.0-SNAPSHOT || ./work/nar/extensions/nifi-standard-nar-1.6.0-SNAPSHOT.nar-unpacked
        org.apache.nifi.controller.MonitorDiskUsage
                org.apache.nifi:nifi-standard-nar:1.6.0-SNAPSHOT || ./work/nar/extensions/nifi-standard-nar-1.6.0-SNAPSHOT.nar-unpacked
        com.blah.cloud.datamanager.tasks.CSReportingTask
                com.blah.cloud.datamanager:nifi-csreporting-nar:1.0-SNAPSHOT || ./work/nar/extensions/nifi-csreporting-nar-1.0-SNAPSHOT.nar-unpacked&amp;lt;br&amp;gt;2018-06-05 04:03:29,056 INFO [Timer-Driven Process Thread-9] o.a.n.c.s.TimerDrivenSchedulingAgent CSReportingTask[id=ce15e357-0163-1000-0000-0000139a1779] started.
&lt;/PRE&gt;&lt;P&gt;My Reporting Task code&lt;/P&gt;&lt;PRE&gt;public class CSReportingTask extends AbstractReportingTask {
    @Override
    public void onTrigger(ReportingContext context) {
        EventAccess eventAccess = context.getEventAccess();
        ProcessGroupStatus groupStatus = eventAccess.getControllerStatus();
        Collection&amp;lt;ProcessorStatus&amp;gt; processorStatus = groupStatus.getProcessorStatus();
        String nodeId = context.getClusterNodeIdentifier();
        for (ProcessorStatus status : statuses) {
            String groupID = status.getGroupId();
            String name = status.getName();
            String execNode = status.getExecutionNode().name();
            String id = status.getId();
            String type = status.getType();
            String runStatus = status.getRunStatus().name();
            getLogger().info("id: {}; name: {}; groupID: {}; execNode: {}; type: {}; runStatus: {}; nodeID: {}", new Object[]{id, name, groupID, execNode, type, runStatus, nodeId});
        }
    }
}&lt;/PRE&gt;</description>
      <pubDate>Tue, 05 Jun 2018 21:43:04 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Custom-reporting-task-not-triggering/m-p/209192#M79209</guid>
      <dc:creator>praveen_bathala</dc:creator>
      <dc:date>2018-06-05T21:43:04Z</dc:date>
    </item>
    <item>
      <title>Re: Custom reporting task not triggering</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Custom-reporting-task-not-triggering/m-p/209193#M79210</link>
      <description>&lt;P&gt;Your getLogger.info(...) statement is inside a for loop over "statuses" and I don't see a variable called statuses so it is hard to say what is in the variable, but if that is an empty collection then you might not be executing your for loop. I would try putting a logging statement right at the beginning of onTrigger to see if the reporting task is even executed.&lt;/P&gt;</description>
      <pubDate>Wed, 06 Jun 2018 02:05:44 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Custom-reporting-task-not-triggering/m-p/209193#M79210</guid>
      <dc:creator>bbende</dc:creator>
      <dc:date>2018-06-06T02:05:44Z</dc:date>
    </item>
    <item>
      <title>Re: Custom reporting task not triggering</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Custom-reporting-task-not-triggering/m-p/209194#M79211</link>
      <description>&lt;P&gt;statuses variable not in code is a copy paste error. I did add more logging and I see the statuses is empty which is why nothing logs.&lt;/P&gt;</description>
      <pubDate>Wed, 06 Jun 2018 23:16:10 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Custom-reporting-task-not-triggering/m-p/209194#M79211</guid>
      <dc:creator>praveen_bathala</dc:creator>
      <dc:date>2018-06-06T23:16:10Z</dc:date>
    </item>
    <item>
      <title>Re: Custom reporting task not triggering</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Custom-reporting-task-not-triggering/m-p/209195#M79212</link>
      <description>&lt;A rel="user" href="https://community.cloudera.com/users/363/bbende.html" nodeid="363"&gt;@Bryan Bende&lt;/A&gt;&lt;P&gt; Similar question along same lines. I want to report metrics from nifi at the processor level and processor group level and I was able to get this metrics from the rest API, but I am when I get aggregate snapshot I am worried that all nodes will send exactly the same metrics which might show wrong values after aggregation in graphite or I planned to use node level metrics snapshot, if I can compare the node which is sending data can only send its specific metrcis not all nodes metrics. &lt;/P&gt;&lt;P&gt;Is this possible ? or there is a better solution to get fine level metrics ?&lt;/P&gt;</description>
      <pubDate>Thu, 07 Jun 2018 05:30:26 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Custom-reporting-task-not-triggering/m-p/209195#M79212</guid>
      <dc:creator>praveen_bathala</dc:creator>
      <dc:date>2018-06-07T05:30:26Z</dc:date>
    </item>
    <item>
      <title>Re: Custom reporting task not triggering</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Custom-reporting-task-not-triggering/m-p/209196#M79213</link>
      <description>&lt;P&gt;I don't know that much about the internals of NiFi's metrics, but when you use the REST API it should be making a federated request to all the nodes, which is different from a reporting task which should only have the metrics for the given node it is running on. &lt;/P&gt;</description>
      <pubDate>Fri, 08 Jun 2018 00:09:42 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Custom-reporting-task-not-triggering/m-p/209196#M79213</guid>
      <dc:creator>bbende</dc:creator>
      <dc:date>2018-06-08T00:09:42Z</dc:date>
    </item>
  </channel>
</rss>

