Describe the bug
RestClient is currently instrumented using a BeanPostProcessor.
However, it is typical to use the RestClient using the RestClient.Builder e.g.
RestClient.builder()
.baseUrl("http://localhost:8080")
.requestInterceptors(System.out::println)
.build()
.get()
.retrieve()
.body(String.class);
In this case no instrumentation is present.
Steps to reproduce
Create a RestClient using the Builder. Have it print its interceptors.
Observe that the list is empty.
RestClient.builder()
.baseUrl("http://localhost:8080")
.requestInterceptors(System.out::println)
.build()
.get()
.retrieve()
.body(String.class);
Expected behavior
A interceptor is added to the RestClient.
Actual behavior
No interceptor is added.
Javaagent or library instrumentation version
2.17
Environment
JDK:
OpenJDK
OS:
Windows/Linux
Additional context
Solution
The RestClient should be instrumented in a similar fashion to the WebClient
Tip
React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding +1 or me too, to help us triage it. Learn more here.
Describe the bug
RestClientis currently instrumented using a BeanPostProcessor.However, it is typical to use the
RestClientusing theRestClient.Buildere.g.In this case no instrumentation is present.
Steps to reproduce
Create a RestClient using the Builder. Have it print its interceptors.
Observe that the list is empty.
Expected behavior
A interceptor is added to the RestClient.
Actual behavior
No interceptor is added.
Javaagent or library instrumentation version
2.17
Environment
JDK:
OpenJDK
OS:
Windows/Linux
Additional context
Solution
The
RestClientshould be instrumented in a similar fashion to the WebClientTip
React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding
+1orme too, to help us triage it. Learn more here.