Record response errors as events in Request Observations
Prior to this commit, GraphQL Request Observations would not record errors as Observation errors, because with GraphQL errors can partially affect the response and there can be multiple. Instead, an invalid request (for example) would lead to a `"graphql.outcome", "REQUEST_ERROR"` low cardinality KeyValue. In this case, developers would not know what type of error occured nor if there were multiple. This commit records all errors listed in the GraphQL as Observation.Event on the request Observation. Such events are usually handled by the tracing handler and are recorded as span annotations for traces. Other `ObservationHandler` annotations can leverage events in a different fashion. Closes gh-859
This commit is contained in:
@@ -41,6 +41,16 @@ The `graphql.outcome` KeyValue will be `"SUCCESS"` if a valid GraphQL response h
|
||||
|`graphql.execution.id` _(required)_|`graphql.execution.ExecutionId` of the GraphQL request.
|
||||
|===
|
||||
|
||||
Spring for GraphQL also contributes Events for Server Request Observations.
|
||||
https://docs.micrometer.io/micrometer/reference/observation/components.html#micrometer-observation-events[Micrometer Observation Events] are usually handled as span annotations in traces.
|
||||
This instrumentation records errors listed in the GraphQL response as events.
|
||||
|
||||
.Observation Events
|
||||
[cols="a,a"]
|
||||
|===
|
||||
|Name | Contextual Name
|
||||
|the GraphQL error type, e.g. `InvalidSyntax`|the full GraphQL error message, e.g. `"Invalid syntax with offending token 'invalid'..."`
|
||||
|===
|
||||
|
||||
|
||||
[[observability.server.datafetcher]]
|
||||
|
||||
Reference in New Issue
Block a user