In Apache NiFi, there are multiple ways to monitor the different statistics of the system like errors, memory usage, CPU usage, Data Flow statistics, etc. We will discuss the most popular ones in this tutorial.
In this section, we will learn more about in built monitoring in Apache NiFi.
The bulletin board shows the latest ERROR and WARNING getting generated by NiFi processors in real time. To access the bulletin board, a user will have to go the right hand drop down menu and select the Bulletin Board option. It refreshes automatically and a user can disable it also. A user can also navigate to the actual processor by double-clicking the error. A user can also filter the bulletins by working out with the following −
To monitor the Events occurring on any specific processor or throughout NiFi, a user can access the Data provenance from the same menu as the bulletin board. A user can also filter the events in data provenance repository by working out with the following fields −
Apache NiFi summary also can be accessed from the same menu as the bulletin board. This UI contains information about all the components of that particular NiFi instance or cluster. They can be filtered by name, by type or by URI. There are different tabs for different component types. Following are the components, which can be monitored in the NiFi summary UI −
In this UI, there is a link at the bottom right hand side named system diagnostics to check the JVM statistics.
Apache NiFi provides multiple reporting tasks to support external monitoring systems like Ambari, Grafana, etc. A developer can create a custom reporting task or can configure the inbuilt ones to send the metrics of NiFi to the externals monitoring systems. The following table lists down the reporting tasks offered by NiFi 1.7.1.
S.No. | Reporting Task Name | Description |
---|---|---|
1 | AmbariReportingTask | To setup Ambari Metrics Service for NiFi. |
2 | ControllerStatusReportingTask | To report the information from the NiFi summary UI for the last 5 minute. |
3 | MonitorDiskUsage | To report and warn about the disk usage of a specific directory. |
4 | MonitorMemory | To monitor the amount of Java Heap used in a Java Memory pool of JVM. |
5 | SiteToSiteBulletinReportingTask | To report the errors and warning in bulletins using Site to Site protocol. |
6 | SiteToSiteProvenanceReportingTask | To report the NiFi Data Provenance events using Site to Site protocol. |
There is an API named system diagnostics, which can be used to monitor the NiFI stats in any custom developed application. Let us check the API in postman.
http://localhost:8080/nifi-api/system-diagnostics
{ "systemDiagnostics": { "aggregateSnapshot": { "totalNonHeap": "183.89 MB", "totalNonHeapBytes": 192819200, "usedNonHeap": "173.47 MB", "usedNonHeapBytes": 181894560, "freeNonHeap": "10.42 MB", "freeNonHeapBytes": 10924640, "maxNonHeap": "-1 bytes", "maxNonHeapBytes": -1, "totalHeap": "512 MB", "totalHeapBytes": 536870912, "usedHeap": "273.37 MB", "usedHeapBytes": 286652264, "freeHeap": "238.63 MB", "freeHeapBytes": 250218648, "maxHeap": "512 MB", "maxHeapBytes": 536870912, "heapUtilization": "53.0%", "availableProcessors": 4, "processorLoadAverage": -1, "totalThreads": 71, "daemonThreads": 31, "uptime": "17:30:35.277", "flowFileRepositoryStorageUsage": { "freeSpace": "286.93 GB", "totalSpace": "464.78 GB", "usedSpace": "177.85 GB", "freeSpaceBytes": 308090789888, "totalSpaceBytes": 499057160192, "usedSpaceBytes": 190966370304, "utilization": "38.0%" }, "contentRepositoryStorageUsage": [ { "identifier": "default", "freeSpace": "286.93 GB", "totalSpace": "464.78 GB", "usedSpace": "177.85 GB", "freeSpaceBytes": 308090789888, "totalSpaceBytes": 499057160192, "usedSpaceBytes": 190966370304, "utilization": "38.0%" } ], "provenanceRepositoryStorageUsage": [ { "identifier": "default", "freeSpace": "286.93 GB", "totalSpace": "464.78 GB", "usedSpace": "177.85 GB", "freeSpaceBytes": 308090789888, "totalSpaceBytes": 499057160192, "usedSpaceBytes": 190966370304, "utilization": "38.0%" } ], "garbageCollection": [ { "name": "G1 Young Generation", "collectionCount": 344, "collectionTime": "00:00:06.239", "collectionMillis": 6239 }, { "name": "G1 Old Generation", "collectionCount": 0, "collectionTime": "00:00:00.000", "collectionMillis": 0 } ], "statsLastRefreshed": "09:30:20 SGT", "versionInfo": { "niFiVersion": "1.7.1", "javaVendor": "Oracle Corporation", "javaVersion": "1.8.0_151", "osName": "Windows 7", "osVersion": "6.1", "osArchitecture": "amd64", "buildTag": "nifi-1.7.1-RC1", "buildTimestamp": "07/12/2018 12:54:43 SGT" } } } }