-
Notifications
You must be signed in to change notification settings - Fork 305
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
Create optimized RequestPredicate for GraphQL endpoints #906
Comments
Prior to this commit, we introduced in gh-906 custom `RequestPredicates` for faster and more efficient matching. These custom WebFlux and MVC predicates did not set the matching `PathPattern` as a request attribute for positive matches. This value is used by observability conventions for metrics and traces KeyValues; as a result, observation metadata is missing the "uri" metadata and is using the "UNKNOWN" value instead. This commit adds the missing request attribute in our custom request predicates. Fixes gh-987
@bclozel Is it possible to customize this behavior? I see that |
@fdulger you can implement a custom request predicate, similar to the ones in |
@fdulger Another idea: you could configure a Servlet Filter that wraps the request and manually sets a Content-Type if it is empty and path targets the graphql endpoint. You could then even track the lagging clients at this stage. This is probably less complex and would not require undoing Spring Boot auto-configuration. |
Thanks a lot for the suggestions! Servlet filter indeed does the work. |
Right now, the Spring Boot auto-configuration composes several
RequestPredicate
instances to handle GraphQL requests. Composing there can incur some overhead and no practical advantage in our case. Spring for GraphQL should instead provide customRequestPredicate
implementations that are optimized for optimal performance.They should be then leveraged in the Spring Boot auto-configuration.
The text was updated successfully, but these errors were encountered: