Prometheus集成spring-boot

DevOps Prometheus评论2,526字数 538阅读1分47秒阅读模式

引入pom依赖

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

添加配置(application.yml)

management:
  endpoints:
    web:
      exposure:
        include: 'prometheus'
  metrics:
    tags:
     application: ${spring.application.name}

去除访问限制(SecurityConfig.java)

/actuator/**

Prometheus集成spring-boot

测试指标接口

浏览器访问:http://localhost:8080/actuator/prometheus

展示信息如下:

Prometheus集成spring-boot

DevOps
  • 本文由 发表于 2022年11月5日 20:06:36
  • 除非特殊声明,本站文章均为原创,转载请务必保留本文链接
prometheus告警规则 Prometheus

prometheus告警规则

基础监控 主机内存不足 节点内存已满(剩余 < 10%) groups: - name: Node memory is filling up (< 10% left) rul...
评论  0  访客  0

发表评论