How to include JSON response body in Spring Boot Actuator's Trace?

前端 未结 3 1892
星月不相逢
星月不相逢 2020-12-16 13:41

Spring Boot Actuator\'s Trace does a good job of capturing input/output HTTP params, headers, users, etc. I\'d like to expand it to also capture the body of the

3条回答
  •  太阳男子
    2020-12-16 14:05

    With a webflux reactive stack, it is possible to capture http request and response body using spring-cloud-gateway and inject them into actuator httptrace by defining a custom HttpTraceWebFilter.

    See full associated code at https://gist.github.com/gberche-orange/06c26477a313df9d19d20a4e115f079f

    This requires quite a bit of duplication, hopefully springboot team will help reduce this duplication, see related https://github.com/spring-projects/spring-boot/issues/23907

提交回复
热议问题