“httptrace” endpoint of Spring Boot Actuator doesn't exist anymore with Spring Boot 2.2.0

≯℡__Kan透↙ 提交于 2020-04-11 01:59:30

问题


With Spring Boot 2.2.0 the "httptrace" Actuator endpoint doesn't exist anymore. How can I get this functionality back?


回答1:


The functionality has been removed by default in Spring Boot 2.2.0. To fix it, add this configuration to the Spring environment:

management.endpoints.web.exposure.include: httptrace

and provide a HttpTraceRepository bean like this:

@Configuration
// @Profile("actuator-endpoints") /* register bean only if profile is set if you want */
public class HttpTraceActuatorConfiguration {

    @Bean
    public HttpTraceRepository httpTraceRepository() {
        return new InMemoryHttpTraceRepository();
    }

}

http://localhost:8080/actuator/httptrace works again.




回答2:


You need to enable httptrace by having following application properties. By default it is disabled

management.trace.http.enabled: true
management.endpoints.web.exposure.include: httptrace

and Requires an HttpTraceRepository bean. You can use Your own Custom implementation or InMemoryHttpTraceRepository



来源:https://stackoverflow.com/questions/59115578/httptrace-endpoint-of-spring-boot-actuator-doesnt-exist-anymore-with-spring-b

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!