当前位置:网站首页>prometheus监控nacos
prometheus监控nacos
2022-07-28 05:27:00 【opreator.ke】
1.nacos
官方文档:https://nacos.io/zh-cn/docs/monitor-guide.html
版本:docker 1.4.1
修改配置文件:/home/nacos/conf/application.properties
增加配置,,暴露metrics数据
management.endpoints.web.exposure.include=*重启nacos
访问{ip}:8848/nacos/actuator/prometheus,看是否能访问到metrics数据
2.prometheus
修改prometheus.yml,增加配置
- job_name: 'nacos'
metrics_path: '/nacos/actuator/prometheus'
static_configs:
- targets: ['192.168.1.1:8848']
labels:
instance: 'nacos'重启prometheus 生效,并进入prometheus,输入nacos_monitor,有数据产生则ok ,如图

3.grafana 引入nacos官方grafana json模板
官方地址:https://github.com/nacos-group/nacos-template/blob/master/nacos-grafana.json
直接导入会导致无数据,需要调整2处地方。
3.1数据源不正确问题
- [nacos 官方给的监控模板](https://github.com/nacos-group/nacos-template)中的数据源名称为 `prometheus` ,而 `Grafana` 默认的 Prometheus 数据源名称为 `Prometheus`(P大写),由于不匹配,导致不会显示任何数据。
直接调整编辑nacos-grafana.json ,替换为Prometheus
3.2 标签没有正确匹配,调衡Variables,
增加Query
label_values(instance)
增加Regex 正则匹配nacos
(nacos-.*)
如图

4 监控实图

边栏推荐
猜你喜欢
随机推荐
OJ 1018 报数游戏
Mysql-8.0.17-winx64 (additional Navicat) manual configuration version installation
动态规划--简单题型之爬楼梯
[dynamic planning -- the best period for buying and selling stocks series 3]
OJ 1089 春运
mongoDB快速入门
[C note] data type and storage
Two dimensional array practice: spiral matrix
redis缓存设计与性能优化
Treasure plan TPC system development DAPP construction
Project compilation nosuch*** error problem
[pta---- output full arrangement]
Water drop effect on umbrella
NiO example
费马小定理
Leetcode 刷题日记 剑指 Offer II 053. 二叉搜索树中的中序后继
OJ 1451 digital games
Valgrind tool
OJ 1129 分数矩阵
OJ 1253 点菜问题









