📅  最后修改于: 2020-11-18 08:44:46             🧑  作者: Mango
在Apache NiFi中,有多种方法可以监视系统的不同统计信息,例如错误,内存使用率,CPU使用率,数据流统计信息等。我们将在本教程中讨论最受欢迎的统计信息。
在本节中,我们将详细了解Apache NiFi中的内置监视。
公告栏显示NiFi处理器实时生成的最新错误和警告。要访问公告板,用户将必须转到右侧的下拉菜单,然后选择“公告板”选项。它会自动刷新,用户也可以禁用它。用户还可以通过双击错误导航到实际处理器。用户还可以通过执行以下操作来过滤公告:
要监视发生在任何特定处理器上或整个NiFi上的事件,用户可以从公告板所在的菜单访问数据来源。用户还可以通过处理以下字段来过滤数据源存储库中的事件:
也可以从公告板的同一菜单访问Apache NiFi摘要。该用户界面包含有关该特定NiFi实例或群集的所有组件的信息。可以按名称,类型或URI进行过滤。不同的组件类型有不同的选项卡。以下是可在NiFi摘要界面中监控的组件-
在此UI中,右下角有一个名为system diagnostics的链接,用于检查JVM统计信息。
Apache NiFi提供了多种报告任务来支持外部监视系统,例如Ambari,Grafana等。开发人员可以创建自定义报告任务,也可以配置内置报告任务,以将NiFi指标发送到外部监视系统。下表列出了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. |
有一个名为系统诊断的API,可用于监视任何定制开发的应用程序中的NiFI统计信息。让我们检查邮递员中的API。
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"
}
}
}
}