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
bug: Some invalid queries get exposed as "unknown" or "Intenal" instead of "ValidationError" or "BadRequest" in micrometer #1058
Comments
Thanks @hpuac, it should be consistent with |
Closing this issue since it should be addressed in the latest release. Please reopen, if issue exists. |
Hey @srinivasankavitha, sorry for the delay but I was now able to re-test it with DGS 5.0.5.
|
Hey @berngp and @srinivasankavitha, should I create a new issue or will you reopen this one? 🙂 |
Let's keep this one. |
@berngp do you have the rights to reopen it? I don't have any button for it. |
#1058: Correct error types for bad user input in micrometer
Expected behavior
When modifying the GraphQL request and sending a variable that is not in the query, I would expect it to get exposed as
ValidationError
orBAD_REQUEST
in micrometer.Actual behavior
unknown
in micrometer.INTERNAL
in micrometer.This is preventing me to exclude client errors from our alerting that we base on these metrics.
Steps to reproduce
I think the behaviour description is pretty self explanatory. Please let me know if something is not clear.
But I'd like to provide some additional information.
DgsGraphQLMetricsInstrumentation->instrumentExecutionResult
receives isgraphql.execution.InputMapDefinesTooManyFieldsException: The variables input contains a field name 'myDemoKey' that is not defined for input object type 'MyDemoInput'
. TheErrorUtils.sanitizeErrorPaths()
call then sets the type tounknown
.INTERNAL
is exposed, the exception thatDgsGraphQLMetricsInstrumentation->instrumentExecutionResult
receives isTypedGraphQLError{message='java.lang.IllegalStateException: Expected key 'myDemoKey' in received federated values map does not exist.', locations=[], path=[_entities], extensions={errorType=INTERNAL}}
. TheErrorUtils.sanitizeErrorPaths()
call then sets the type toINTERNAL
.The text was updated successfully, but these errors were encountered: