Apache NiFi 0.3.0 adds a ReportingTask to send metrics to Ambari, the ticket for this work is NIFI-790.
Sending metrics is somewhat independent of doing something useful with them in Ambari, so this page describes how you could configure Ambari to make use of these metrics.
Step-by-step guide
- Define a NIFI service in Ambari
- An example service definition can be downloaded here.
- The contents of this zip file are meant to be overlaid in the resources directory of the ambari-server installation, in many cases this would be /var/lib/ambari-server/resources.
- After placing the directories and files in the right location, restart ambari-server and ambari-agent
- Issue REST commands to tell Ambari to install the NIFI service:
- POST http://<host>:<port>/api/v1/clusters/<cluster-name>/services/NIFI
- POST http://<host>:<port>/api/v1/clusters/<cluster-name>/services/NIFI/components/NIFI_MASTER
- POST http://<host>:<port>/api/v1/clusters/<cluster-name>/hosts/<hostname>/host_components/NIFI_MASTER
- Go to Ambari and select to "Re-Install" the service
- Select to Start the service
- Assuming you have the AmbariReportingTask running on a NiFi instance somewhere pointing to the given Ambari instance, you should see metrics on the NIFI Service page with in a few minutes.