本文最后更新于 556 天前,其中的信息可能已经有所发展或是发生改变。
kube-prometheus监控Nacos集群
nacos配置
nacos默认是没有开启指标,需要修改application.properties
配置文件,暴露metrics数据
management.endpoints.web.exposure.include=*
重启服务,可成功访问返回数据则是正常。
kube-prometheus配置
方法一:使用ServiceMonitor
集群内使用,推荐此方法。
方法二:使用prometheus-additional.yaml
编辑prometheus-additional.yaml
,添加
执行命令更新配置
kubectl delete secret additional-configs -n monitoring >/dev/null 2>&1
kubectl create secret generic additional-configs --from-file=prometheus-additional.yaml -n monitoring
检查prometheus配置是否正常
kubectl exec -it prometheus-k8s-1 -n monitoring -- promtool check config /etc/prometheus/config_out/prometheus.env.yaml
重启kube-prometheus
grafana配置nacos监控图表
图表地址参考:https://grafana.com/grafana/dashboards/13221-nacos/
告警规则
参考官网指标参数:https://nacos.io/zh-cn/docs/monitor-guide.html