springboot整合prometheus(三)
1. 加入prometheus依赖
<dependency>
<groupId>io.prometheus</groupId>
<artifactId>simpleclient_spring_boot</artifactId>
<version>0.4.0</version>
</dependency> <dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
<groupId>io.micrometer</groupId>
<artifactId>micrometer-core</artifactId>
</dependency>
<dependency>
<groupId>io.micrometer</groupId>
<artifactId>micrometer-registry-prometheus</artifactId>
</dependency>2. 配置开启prometheus
3. 验证
4. 关闭不需要的内置监控项
4. 配置自定义监控项
自定义一个metrics 收集器
Last updated
Was this helpful?