本文介绍了“httptrace"Spring Boot 2.2.0 不再存在 Spring Boot Actuator 的端点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在 Spring Boot 2.2.0 中,httptrace"Actuator 端点不再存在.我如何才能恢复此功能?

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

推荐答案

功能已经在 Spring Boot 2.2.0 中默认删除.要修复它,请将此配置添加到 Spring 环境中:

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

并提供一个 HttpTraceRepository bean,如下所示:

and provide a HttpTraceRepository bean like this:

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

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

}

http://localhost:8080/actuator/httptrace 再次工作.

这篇关于“httptrace"Spring Boot 2.2.0 不再存在 Spring Boot Actuator 的端点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-04 11:21