spring-projects / spring-boot

Spring Boot helps you to create Spring-powered, production-grade applications and services with absolute minimum fuss.
https://spring.io/projects/spring-boot
Apache License 2.0
75.19k stars 40.69k forks source link

Consider sending timing header in responses when using DevTools #8736

Open philwebb opened 7 years ago

philwebb commented 7 years ago

As suggested in this tweet it's worth looking to see if we can send the HTTP headers that are automatically picked up by Chrome Devtools.

bclozel commented 7 years ago

I don't think this feature would be useful for actuators - this would just give you how long each healthindicator took - something already considered in #9333.

Looking at the feature, I think this is meant to provide information about how time was spent on the server while processing an application request - some kind of application profiling feature that could be enabled with devtools. See an example of that with the Symfony profiler.

This could be really useful, but I don't think we have the required hooks/instrumentation infrastructure to get those numbers for any application request — or at least this is a much larger endeavor than exposing those metrics.

Maybe we could expose spring-cloud-sleuth traces? This would only consider remote calls, though.

bclozel commented 6 years ago

See SPR-17035.

bclozel commented 5 years ago

After discussing this with the team, we think that such a feature could be useful to measure how time and resources are being spent on the server.

In production, such a feature is better supported by metrics, Spring Cloud Sleuth and distributed tracing libraries in general. because they provide a view of the whole system and support sampling.

At development time, with Spring Boot devtools, we could have such support; right now we don't have any additional data we could expose there and we would need to build a whole infrastructure to collect and expose those metrics.

Additional support from Spring Framework might be needed in spring-projects/spring-framework#21573

bclozel commented 10 months ago

It would be interesting to see how https://github.com/sercasti/spring-httpserver-timings-java17 evolves, how the community is using it and if additional infrastructure is needed in Spring Boot or Micrometer to support it.