-
Notifications
You must be signed in to change notification settings - Fork 41.2k
Deprecation reason for the autotime enabled, percentiles, and percentiles-historgram properties is confusing #41745
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@Component
class MyBean implements CommandLineRunner {
private static final Logger LOGGER = LoggerFactory.getLogger(MyBean.class);
private final RestTemplate restTemplate;
MyBean(RestTemplateBuilder restTemplateBuilder) {
this.restTemplate = restTemplateBuilder.build();
}
@Override
public void run(String... args) throws Exception {
String content = this.restTemplate.getForObject(URI.create("http://example.com/"), String.class);
LOGGER.info("Content: {}", content);
}
} creates
Does that solve your problem? |
Sorry, I was editing the post and about to save just as you posted yours. Yes, thank you, I had found out about this earlier. But the fact still stands that it's not clear for people who switched from Spring Boot 2 that the feature they previously activated with |
Did you read https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-3.0-Migration-Guide#micrometer-and-metrics-changes and it's still unclear? |
Yeah, i agree with that. I think we should reword this to something like "Is now enabled automatically". |
The paragraph itself is clear but, since it doesn't explicitly mention that Observers can record times too, someone who never used the Observations API and just had put But anyway, I see you agree with me on that sentence being too vague. Changing that would be enough to save other people the time I spent on this >_> |
Uh oh!
There was an error while loading. Please reload this page.
Hello, as of Spring Boot 3 the
management.metrics.web.server.request.autotime
configuration properties were removed and the following note was left:Should be applied at the ObservationRegistry level.
There's no explanation anywhere on how to do that.
Can something please be added to the documentation, or to the migration guide?
I've found no new alternative to configure the application to automatically measure the durations of RestTemplate exchanges. The only way I can see it being done is by using a custom interceptor that does it somehow. Otherwise I guess we have to explicitly measure times using
Observation
s to wrap the code that uses a RestTemplate to make remote calls?Sorry if this issue looks "StackOverflow-y" but there's honestly no info about this in the docs and the few already existing questions on StackOverflow have no answers or comments.
Edit: I've found this chapter of the documentation. By what I understand, at least for RestTemplate and WebClient, calls are observed by default, including their duration?
Anyway, for someone who had no idea about the Observations API before having to switch to Spring Boot 3, it's really time-consuming to understand where the feature that was previously granted by
management.metrics.web.server.request.autotime.enabled = true
ended up. In my opinion it's better to explicitly state, at least in the migration guide, that the new way is to configure anObservationRegistry
on the HTTP client of choice, and that it's done automatically for RestTemplate and WebClient (for now?). Also providing an example in the guide would be great.The text was updated successfully, but these errors were encountered: