美文网首页
spring boot监控之prometheus配置

spring boot监控之prometheus配置

作者: 程序员大亨 | 来源:发表于2020-11-23 16:36 被阅读0次

    1.spring boot工程引入jar包

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

    2.修改spring boot工程配置

    management:
      server:
        port: 10091
      endpoints:
        web:
          exposure:
            include: '*'
    

    3.启动Spring boot工程

      启动后访问[http://localhost:10091/actuator](http://localhost:10091/actuator),应该能看到返回很多链接,如能看到[http://localhost:10091/actuator/prometheus](http://localhost:10091/actuator/prometheus), 说明正确。
    

    4.转载

    https://www.cnblogs.com/season2009/p/12424882.html
    

    相关文章

      网友评论

          本文标题:spring boot监控之prometheus配置

          本文链接:https://www.haomeiwen.com/subject/hwdviktx.html