You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Let DataFetcher Instrumenter accept the response as Object instead of Void and use DataFetcherResult for Span Status in graphql-java instrumentation #15281
Is your feature request related to a problem? Please describe.
The technical problem:
To propose changing the signature of dataFetcherInstrumenter (internal) in io.opentelemetry.instrumentation.graphql.v20_0.GraphqlInstrumenterFactory to Instrumenter<DataFetchingEnvironment, Object> (i.e. RESPONSE from Void to Object).
Additionally, the default createDataFetcherInstrumenter to set a SpanStatusExtractor to perform a result instanceof DataFetcherResult and use hasErrors() to set Span Status to Error before defaulting to the Throwable. Basically copying existing behaviour for operations.
The use case:
The GraphQL-Java framework allows DataFetchers to return DataFetcherResultDataFetcherResult - graphql-java 20.0 javadoc. This can contain errors objects that signify error that is currently missed unless you look at the operation span.
There is also no way to customise this behaviour through the incubating InstrumenterCustomizer because the input is missing.
Describe the solution you'd like
I think this should be a straightforward change if there are no objections. As described above.
Describe alternatives you've considered
It doesn’t seem that an alternative exists, but I’m open to suggestions.
Additional context
N/A
Tip
React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding +1 or me too, to help us triage it. Learn more here.