【发布时间】:2022-10-22 00:00:50
【问题描述】:
我正在尝试在具有以下依赖项的 springboot 项目中启用 Prometheus 端点。
春季启动版本:
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.6.12-SNAPSHOT</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
依赖项:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>io.micrometer</groupId>
<artifactId>micrometer-registry-prometheus</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<scope>runtime</scope>
<optional>true</optional>
</dependency>
我正在使用 restTemplate 进行出站呼叫,但是当我检查 Prometheus 端点时,数据与http_client_requests_* 缺失
应用属性:
management.endpoints.web.exposure.include=health,metrics,prometheus
management.endpoint.health.show-details=always
management.endpoint.health.enabled=true
management.endpoint.info.enabled=true
management.metrics.web.server.request.autotime.percentiles=0.90,0.95
management.metrics.web.client.request.autotime.percentiles=0.90,0.95
management.metrics.web.client.request.autotime.enabled=true
【问题讨论】:
-
我还使用
RestTemplate进行外呼,当我访问/actuator/metrics时没有看到http.client.requests。
标签: spring-boot prometheus spring-boot-actuator spring-micrometer