micronaut-micrometer
micronaut-micrometer copied to clipboard
URI_TEMPLATE not set for pre-flight requests
Hi!
OPTIONS-requests do not get URI_TEMPLATE set which results in an ever growing list of uri tags for http.server.request metrics and may cause OOM in the end for routes with dynamic path segments.
The reason is that URI_TEMPLATE is set in RoutingInBoundHandler which runs after the CorsFilter.
Micronaut 2.0.3
My workaround for now is a micrometer MeterFilter that removes metrics with method=="OPTIONS"
Do you have an example that reproduces the issue?
Here u go: https://github.com/luckyswede/micronaut-options-metrics
@luckyswede The URI_TEMPLATE is set before the filter, however the issue is that no route matches the OPTIONS request, therefore the uri template is not set because there is no route to get it from.
Transferred this to micrometer because I don't think we can do anything about this in core. Perhaps a config option or something can be added to ignore OPTIONS
@n0tl3ss related issue to the previous one