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
Uri tag replaced with REDIRECTION on all HTTP redirect responses with Jersey server #3327
Comments
Thank you for the report.
It is already configurable because you provide a |
That is what we have done, so it is solvable on our side, but would be nice to be able to use the JerseyTags.uri() method, so we don't have to handle that ourself. I just thought it seemed strange that the default URI jersey tag logic sets the URI to "REDIRECTION", when we already have the "OUTCOME"-tag that should give us that information. |
The point of setting the It was probably out of an abundance of caution that we decided to treat all redirect status codes as unsafe to tag the URI. We can revisit that decision for specific redirect status codes, but it is something we would probably want to standardize across HTTP server instrumentation. |
I understand the caution about tag cardinality explosion, but will that really happen when you are using URI templates? https://github.com/micrometer-metrics/micrometer/blob/main/micrometer-core/src/main/java/io/micrometer/core/instrument/binder/jersey/server/JerseyTags.java#L110 |
As long as there is a matched resource, that assumption may hold true for Jersey server. I think filters could cause a response before the resource is matched, though. We added a check for 404 responses to tag the URI template if a resource was matched in #2587. |
Would this work: #3332? Still not sure if it will ever happen that you have a redirect response without a matching URI template, but it should at least avoid tag cardinality explosion if it can happen. What do you think? |
Yes, I think so. |
I've merged your fix into the |
Please describe the feature request.
It would be nice to be able to choose if you want the URI tag to be replaced with REDIRECTION or not. In many cases it is interesting to get metrics on redirects. "304 Not modified" for example is interesting to track, same for "303 See other", how long those the server actually use to fulfil the request.
This line is the reason for the uri tag being set to REDIRECTION: https://github.com/micrometer-metrics/micrometer/blob/main/micrometer-core/src/main/java/io/micrometer/core/instrument/binder/jersey/server/JerseyTags.java#L91.
Rationale
Uri tag replacement for redirect responses should be configureable. In many cases it is interesting to have metrics on redirections.
The text was updated successfully, but these errors were encountered: