Background

According to this doc, it says Alternatively, when set to false, you can enable instrumentation by adding @Timed to a request-handling method. However our current actuator doesn't recognize the management.metrics.web.server.request.autotime.enabled's value in record(timingContext, request, response, exception) of WebMvcMetricsFilter.java and the actuator's metric doesn't work properly.

Changes

  • Added a testcase for it
  • Checked this.autoTimer.isEnabled()

References

  • https://docs.spring.io/spring-boot/docs/current/reference/html/production-ready-features.html#production-ready-metrics-spring-mvc

Comment From: pivotal-issuemaster

@babjo Please sign the Contributor License Agreement!

Click here to manually synchronize the status of this Pull Request.

See the FAQ for frequently asked questions.

Comment From: pivotal-issuemaster

@babjo Thank you for signing the Contributor License Agreement!

Comment From: snicoll

Turns out this one works in 2.1 already. Seems like a regression introduced with #17026

Comment From: snicoll

@babjo thank you for making your first contribution to Spring Boot.