-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Expose uri template information in a RequestInterceptor #873
Comments
Are you looking for the uri template used or the resolved value? |
I have a question like this. Is there some way to access uri template from RequestTemplate? Do you have any suggestions for me? |
@kdavisk6 The raw template uri (before resolved). We also want to record Currently, we have to do in the following way:
String originalUrl = null;
Map<String, Collection<String>> headers = request.headers();
if (headers.containsKey(ORIGINAL_URI_HEADER)) {
Collection<String> originalUrlHeaders = headers.get(ORIGINAL_URI_HEADER);
if (!originalUrlHeaders.isEmpty()) {
originalUrl = originalUrlHeaders.iterator().next();
// recreate request because of immutable headers
val newHeaders = new HashMap<String, Collection<String>>(headers);
newHeaders.remove(ORIGINAL_URI_HEADER);
request = Request.create(request.method(), request.url(), newHeaders, request.body(), request.charset());
}
} Any suggestions? Thanks! |
By the time the |
Quoted from @whiskeysierra
The request would be aggregated by the unresolved uri template. And a time-series database could be exploded due to a high-cardinality tag. |
Thank you for that clarification. Is there another issue where that quote is from? I'd like to review it further to get a better understanding of what the desired outcome is. |
It's from zalando/riptide#618. By the way, I'm hoping there's something like |
Regarding to #937, I think it's a better way to passing extra information through fragment, and fragment will be stripped off by http client automatically. However, after a deeper investigating, the Any suggestion, @kdavisk6? |
Up until this point, there has been no real need to expose the uri template. I've updated this issue to reflect that we may want to consider exposing the uri template on the For this proposal to move forward, we will need the following:
With those in place, the maintainers and I will work with you to narrow down the scope and agree on an approach. Once agreed, we will open this issue up for PR. |
@pilak do you think this change would help? |
Hi! I think this might be of interest: #1493 |
Arrived at this same issue trying to do something very similar, reporting the service "resource" to Elastic APM, for which only the unresolved uri template is useful. |
Sorry I completely missed the notification for that issue |
Hi there,
I'm looking for a way to access the request pattern url called in a logging interceptor.
Precisely, I need to get the raw url filled in @RequestLine annotation on the client class...
Is that possible ?
Best regards
The text was updated successfully, but these errors were encountered: