-
Notifications
You must be signed in to change notification settings - Fork 41.2k
ClientObservationConventionAdapter overwrites WebClient request attributes #40330
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
Thanks for the report. Spring Boot 3.1.x is almost out of OSS supported, scheduled in roughly a month (2024-05-18). While I do see similarities and inconsistencies (see spring-projects/spring-framework#29885), I believe this behavior has been this way for a long time now and I don't think we should change this right before cutting the OSS support. This is likely to break existing dashboards - arguably, they will break anyway when applications will move to the observation conventions in 3.2.x, since this adapter has been removed in that generation. I'll discuss that with the team. |
I've had another look and it's definitely invalid behavior. I'm pushing a fix for 3.1.x as the existing implementation only breaks expectations. Thanks for your report! |
@bclozel we have upgraded from spring 2.6.6 version to 3.0.7 , in our project and facing the same issue for http webClient requests, the URI_TEMPLATE_ATTRIBUTE is not getting set and its causing lot of uri tags to be generated |
@ranideepa I don't think your problem is related as with this issue the URI_TEMPLATE_ATTRIBUTE was set. |
@bclozel sure ,we will be considering the option to upgrade to newer version, |
Sure. I would suggest asking a question on StackOverflow. |
@bclozel yes have tried few workarounds form stackOverflow to explicitly set the URI_TEMPLATE_ATTRIBUTE , |
Then it's probably a different problem. Try asking a new question, showing how you are using the client and what symptom you are seeing. |
Spring Boot version: 3.0.13
I have noticed that when using WebClient metrics with the built-in convention for adapting
WebClientExchangeTagsProvider
that the URI template is being stripped from the attributes of theClientRequest
. This is caused by theClientObservationConventionAdapter
trying to overwrite the attribute toClientRequestObservationContext.getUriTemplate()
beforeClientRequestObservationContext.setUriTemplate(String)
has been called.Reproduction:
I have worked around this by providing my own adapter convention which avoids overwriting the request attribute. Given this adapter convention has already been removed from Spring Boot 3.2 it might not be worth addressing, but I thought I would report it.
The text was updated successfully, but these errors were encountered: