如何获取 cpu、有关服务结构实例的内存和磁盘信息(可能使用 REST api)?

How to get cpu, memory and disk information about service fabric instances (maybe using REST apis)?

我想获得一些提示来理解构建自定义网页以监控我的服务架构集群状态的最佳和最方便的方式,显示有关集群节点的一些信息,例如 cpu 使用情况,免费磁盘space、内存使用和单个服务的状态。

你可以使用 EventFlow to setup collection of Performance Counters and have that running on a stateless service on each node. From there you could collect which ever Perf Counters, and other health data you generate yourself, in addition to Service Fabric generated health data (such as Diagnostics and performance monitoring for Reliable Actors and Diagnostic functionality for Stateful Reliable Services.

设置输入以收集要显示的事件和指标后,您可以创建自己的 Custom Output,将数据发送到某些存储或服务,您可以从中生成自定义 Web 视图.

另一种方法是在网页中设置 Application Insights output and customize your dashboard to show the information you want. You could even setup export to Power BI if you want to work with that as a visualization tool and them embed your reports/Dashboards

或者,您可以按照评论设置中的建议 OMS/Log Analytics for Service Fabric

如果您能够在集群内的服务中监视和测量此信息,您还可以使用 Metrics and Node Capacity 直接在 Service Fabric 中收集此信息的报告。您可能无论如何都想这样做,以确保 Service Fabric 将容量考虑在内并平衡这些资源的消耗。