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
I would like to trace the timing of resolving the distinct query operations in my graphql project. The metrics are added to the Spring Actuator when the operationName is present in the query, otherwise the operationName is set to "unknown" (see also [https://github.com/graphql-java-kickstart/graphql-java-servlet/issues/264] and [https://spectrum.chat/graphql-java/general/reading-operationname-from-query-text~30cc09d5-0a55-4406-88da-7e8d0b91141a]).
In GraphQLRequestSerializer only the operationType is added to the serialized form. It would be very helpful if also the operationName would be added.
So the serialized query request should be changed from: "query { MyOperationName: MyOperationName(...) {....} }"
to: "query MyOperationName { MyOperationName: MyOperationName(...) {....} }"
The reporting will then change from
# TYPE graphql_timer_query_seconds_max gauge
graphql_timer_query_seconds_max{application="my-service",operation="execution",operationName="unknown",} 0.834386921
graphql_timer_query_seconds_max{application="my-service",operation="validation",operationName="unknown",} 0.011841088
graphql_timer_query_seconds_max{application="my-service",operation="parsing",operationName="unknown",} 0.005506738
Similar to this issue #559, it is an improvement to query.
This is an optional field for the graphql specification, so it depends on whether the author accepts it or not. 😄
I would like to trace the timing of resolving the distinct query operations in my graphql project. The metrics are added to the Spring Actuator when the operationName is present in the query, otherwise the operationName is set to "unknown" (see also [https://github.com/graphql-java-kickstart/graphql-java-servlet/issues/264] and [https://spectrum.chat/graphql-java/general/reading-operationname-from-query-text~30cc09d5-0a55-4406-88da-7e8d0b91141a]).
In GraphQLRequestSerializer only the operationType is added to the serialized form. It would be very helpful if also the operationName would be added.
So the serialized query request should be changed from:
"query { MyOperationName: MyOperationName(...) {....} }"
to:
"query MyOperationName { MyOperationName: MyOperationName(...) {....} }"
The reporting will then change from
to
The text was updated successfully, but these errors were encountered: