Prometheus (prometheus)
原文:https://docs.spring.io/spring-boot/api/rest/actuator/prometheus.html
prometheus 端点以 Prometheus 服务器抓取所需的格式提供 Spring Boot 应用的指标。
检索所有指标
向 /actuator/prometheus 发出 GET 请求:
$ curl 'http://localhost:8080/actuator/prometheus' -i -X GET
响应是 text/plain;version=0.0.4;charset=utf-8 格式的文本,包含指标行,如:
# HELP jvm_buffer_count_buffers An estimate of the number of buffers in the pool # TYPE jvm_buffer_count_buffers gauge jvm_buffer_count_buffers{id="direct"} 3.0
需要添加 io.micrometer:micrometer-registry-prometheus 依赖。支持通过 ?tag=key:value 按标签过滤。