springboot怎么测试别的项目(Prometheus对接springboot)

 2024-07-13  阅读 760  评论 0

摘要:SpringBoot监控:核心代码micrometer:监控指标的度量类库。地址:https://github.com/micrometer-metrics/micrometerorg.springframework.bo

SpringBoot监控:

springboot怎么测试别的项目(Prometheus对接springboot)(1)

核心代码

micrometer:监控指标的度量类库。

地址:https://github.com/micrometer-metrics/micrometer

<!-- web 依赖 --> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-actuator</artifactId> </dependency> <dependency> <groupId>io.micrometer</groupId> <artifactId>micrometer-registry-prometheus</artifactId> </dependency>

application.yml 配置:

# 暴露监控端点 management: endpoints: web: exposure: include: '*'

访问路径,可以查看监控的信息:localhost:8080/actuator/prometheus

springboot怎么测试别的项目(Prometheus对接springboot)(2)

报警配置

Grafana 目录下:grafana.ini,建议新建个人配置文件,下面是mac下配置文件存储位置

/usr/local/etc/grafana/grafana.ini

代码

简单源码:https://gitee.com/lizhifu/tomato-cloud/tree/master/tomato-study/tomato-study-prometheus

,

版权声明:xxxxxxxxx;

原文链接:http://cn.tdroid.net/ce4beCz0EAg0GUFA.html

发表评论:

管理员

  • 内容295795
  • 积分0
  • 金币0
关于我们
lecms主程序为免费提供使用,使用者不得将本系统应用于任何形式的非法用途,由此产生的一切法律风险,需由使用者自行承担,与本站和开发者无关。一旦使用lecms,表示您即承认您已阅读、理解并同意受此条款的约束,并遵守所有相应法律和法规。
联系方式
电话:
地址:广东省中山市
Email:
注册登录
注册帐号
登录帐号

Copyright © 2022 太卓开发网 Inc. 保留所有权利。 泰达科技网易库网

页面耗时0.1147秒, 内存占用1.33 MB, 访问数据库18次