- 进入当前节点的shell
./bin/emqx remote_console
- 查看当前节点的collector有哪一些
执行:
Prev = prometheus_registry:collectors(default).
结果会返回一个这样的列表:
[emqx_prometheus,emqx_prometheus_mria,prometheus_boolean,
prometheus_counter,prometheus_gauge,prometheus_histogram,
prometheus_mnesia_collector,prometheus_quantile_summary,
prometheus_summary,prometheus_vm_dist_collector,
prometheus_vm_memory_collector,
prometheus_vm_msacc_collector,
prometheus_vm_statistics_collector,
prometheus_vm_system_info_collector]
- 清空collector
prometheus_registry:clear(default).
- 再次用命令查看collectors,应该是空的
prometheus_registry:collectors(default).
- 注册新的collector(主要是删除那些影响CPU的collector
Now = Prev -- [prometheus_mnesia_collector, prometheus_vm_dist_collector,prometheus_vm_memory_collector,prometheus_vm_msacc_collector,prometheus_vm_statistics_collector,prometheus_vm_system_info_collector],
prometheus_registry:register_collectors(default, Now).
- 再次用命令查看collector,确认是不是没有那些vm相关的了。没有就是成功了。
- 按ctrl + C 后出再提示,再按小a 字母即 abort ,退出erlang shell
但是下次重启,或新的节点启动,还得按上面的步骤来一次。