Nacos监控Prometheus Grafana

一、nacos集群暴露metrics数据

部署好nacos集群后,配置application.properties文件,暴露metrics数据

management.endpoints.web.exposure.include=*

多个节点按照上面配置,暴露metrics数据,然后重启nacos,

#如果有nginx,也可以通过nginx ip+port进行访问
localhost:8848/nacos/actuator/prometheus 
localhost:8848/nacos/actuator
localhost:8848/nacos/actuator/mappings

这里用了chrome插件JSON-handle

二、搭建Prometheus采集Nacos metrics数据

下载你想安装的prometheus版本,地址为download prometheus

tar xvfz prometheus-*.tar.gz
cd prometheus-*

修改配置文件Prometheus.yml采集nacos metrics数据

此处注意空格,否则报错

scrape_configs:
  # The job name is added as a label `job=<job_name>` to any timeseries scraped from this config.
  - job_name: 'prometheus'

    # metrics_path defaults to '/metrics'
    # scheme defaults to 'http'.

    static_configs:
    - targets: ['localhost:9090']
    
  - job_name: 'nacos'

    metrics_path: '/nacos/actuator/prometheus'
    static_configs:
    - targets: ['210.310.5.143:8848','110.330.5.182:8848','110.340.5.183:8848']

启动prometheus服务

./prometheus --config.file="prometheus.yml"
prometheus.exe --config.file=prometheus.yml

通过访问http://localhost:9090/graph可以看到prometheus的采集数据,在搜索栏搜索nacos_monitor可以搜索到Nacos数据说明采集数据成功

三、搭建grafana图形化展示metrics数据

3.1 安装与启动

和prometheus在同一台机器上安装grafana,使用 yum 安装grafana

sudo yum install https://s3-us-west-2.amazonaws.com/grafana-releases/release/grafana-5.2.4-1.x86_64.rpm
sudo service grafana-server start

下载链接

windows运行

访问grafana: http://localhost:3000

3.2 配置prometheus数据源

3.3 导入nacos grafana监控模板

导入Nacos grafana监控模版  下载很慢提供gitee链接

3.4 nacos监控分为三个模块

3.4.1 nacos monitor展示核心监控项

3.4.2 nacos detail展示指标的变化曲线

3.4.3 nacos alert为警告项

参考1参考2, 参考3参考4

  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值