Spring boot 1.5.x版本集成prometheus监控

1、pom文件依赖

    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>1.5.12.RELEASE</version>
        <relativePath/> <!-- lookup parent from repository -->
    </parent>
<dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>
        <dependency>
            <groupId>io.micrometer</groupId>
            <artifactId>micrometer-registry-prometheus</artifactId>
            <version>1.6.1</version>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-actuator</artifactId>
        </dependency>
         <dependency>
            <groupId>io.micrometer</groupId>
            <artifactId>micrometer-spring-legacy</artifactId>
            <version>1.3.15</version>
        </dependency>
</dependencies>

2、新增配置文件

server:
  port: 8020
  context-path: /${spring.application.name}
spring:
  application:
    name: prometheus-service
management:
  port: ${SPRING_MANAGEMENT_PORT:10001}
  context-path: /${spring.application.name}
  security:
    enabled: false
  endpoints:
    web:
      exposure:
        include:
          - beans
          - prometheus
          - metrics
  metrics:
    tags:
      application: ${spring.application.name}

3、启动spring boot ,网站查看信息;
prometheus信息

http://localhost:10001/prometheus-service/prometheus

bean信息

http://localhost:10001/prometheus-service/beans

metrics信息

http://localhost:10001/prometheus-service/metrics

4、prometheus 服务监控查看文章
https://blog.csdn.net/qq_32415063/article/details/105607008
https://blog.csdn.net/qq_32415063/article/details/105611704

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值