Produce INTERNAL_ERROR observation outcome

Prior to this commit, the `DefaultExecutionRequestObservationConvention`
would only produce "INTERNAL_ERROR" outcomes if the response is null or
if an unresolved exception remains.

The `ExceptionResolversExceptionHandler` will catch all unresolved
exceptions and add them to the errors map with the
`ErorType.INTERNAL_ERROR` error type. This means that the
"INTERNAL_ERROR" outcome is never used.

This commit ensures that this outcome is also used if at least one
resolved error is of `ErorType.INTERNAL_ERROR`.

Fixes gh-1058
This commit is contained in:
Brian Clozel
2024-10-09 12:14:18 +02:00
parent d3cd569e94
commit d7ed85045b
3 changed files with 17 additions and 4 deletions

View File

@@ -32,7 +32,11 @@ By default, the following KeyValues are created:
|===
The `graphql.operation` KeyValue will use the custom name of the provided query, or http://spec.graphql.org/draft/#sec-Language.Operations[the standard name for the operation] if none (`"query"`, `"mutation"` or `"subscription"`).
The `graphql.outcome` KeyValue will be `"SUCCESS"` if a valid GraphQL response has been sent, `"REQUEST_ERROR"` if the request could not be parsed, or `"INTERNAL_ERROR"` if no valid GraphQL response could be produced.
The `graphql.outcome` KeyValue will be:
* `"SUCCESS"` if a valid GraphQL response has been sent and it contains no errors
* `"REQUEST_ERROR"` if the request could not be parsed, or if the response contains errors (none of them being of type `org.springframework.graphql.execution.ErrorType.INTERNAL_ERROR`)
* `"INTERNAL_ERROR"` if no valid GraphQL response could be produced, or if the response contains at least one error of type `org.springframework.graphql.execution.ErrorType.INTERNAL_ERROR`
.High cardinality Keys
[cols="a,a"]