Prometheus集成spring-boot

DevOps Prometheus评论3,290字数 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监控kafka Prometheus

Prometheus监控kafka

前言 Kafka现有开源的集群监控方案:kafka-manager、kafka-monitor、kafka-eagle、KafkaOffsetMonitor,但有所限制监控指标被固化,不易扩展、预警...
Prometheus Prometheus

Prometheus

版本 CentOS Linux release 7.9 Prometheus:prometheus-2.52.0.linux-amd64 Alertmanager:alertma...
评论  0  访客  0

发表评论