公司是今年决定将一些传统应用从虚拟机上迁移到Kubernetes上的,项目多而乱,所以迁移工作进展缓慢,为了建立统一的监控平台,我们使用的是在Kubernetes集群内部署Prometheus-operator,不得不说Prometheus-operator对k8s的监控支持的非常好,helm安装后会把Prometheus、Alertmanger、Grafana、以及NodeExporter都给安装完成,打开Grafana k8s中所有监控指标和图标都已经创建好,大大降低监控部署的复杂性。但是对于我们项目迁移较慢的环境,Promethues只监控k8s集群当然是不行的,所以我们选择使用在虚拟机上部署Node_Exporter来监控虚拟机的各项指标,但是Node_Exporter只能监控系统指标,我们可能想要业务的一些监控,比如(文件状态监控,业务日志监控…都是一些传统软件留下来的坑),这样Node_Exporter就显得力不从心了,而且每个项目监控的一些指标并不相同,所以开发统一Exporter不但耗时还会出现一些兼容性和运维复杂性的问题,所以根据原来zabbix自定义监控项的思路考虑对Node_Exporter进行二次开发,增加一个自定义脚本监控项
Node_Exporter源码目录结构
通过collector目录下源码文件名可以看到具体监控项通过单独的代码文件去采集
more >>