Monitoring GraphQL

Supported information

Supported client-side tracing

For this technology, Instana supports client-side tracing for the following languages and runtimes:

Tracing GraphQL Operations

Instana offers tracing for GraphQL queries, mutations and subscriptions.

For each operation, we capture

Note that we only capture the argument keys, but not the provided values.

Let's take the following query as an example:

  query GetUsers {
    Users(active: true) {
      id
      email
      address
    }
    Orders {
      items
    }
  }

For this query, we would capture:

Call Tag Value
call.graphql.operationType query
call.graphql.operationName GetUsers
call.graphql.arguments Users.active
call.graphql.fields Users.id, Users.email, Users.address, Orders.items

The captured values are displayed in the call details. This helps to immediately see which GraphQL resolvers have been involved in processing the GraphQL operation, making it easy to identify possible reasons for slow responses.

These tags can also be used to search for calls and traces in the Analytics view, by adding filters via the "More" button. For example, to search for all GraphQL operations involving the Orders object type, simply click "More" to add a filter for calls where the call tag call.graphql.fields contains Orders. Or, after setting the tag to call.graphql.fields, check the suggested options in the "Value" drop down to inspect which object types and fields have been requested in the selected time frame at all. Another use case could be to find all calls accessing a particular field or make use of a certain argument by adding a "contains" filter for call.graphql.fields or call.graphql.arguments with the field/argument name in question.

Tracing GraphQL Subscriptions

GraphQL clients can ask a GraphQL server to notify them of changes in the underlying data model by means of GraphQL subscriptions.

Each time a client receives an update due to one of its active GraphQL subscriptions, we trace this subscription update as a call from the GraphQL server to the client. That is, Instana focuses the distributed tracing of subscriptions around documenting the impact that mutations have on the server and the affected subscribers.

A trace showing a mutation and the ensuing subscriber updates.

Calls representing subscription updates are tagged with subscription-update as the value for the call.graphql.operationType tag. To ease the analysis of the impact of particular subscription, all subscription update calls are grouped in the GraphQL Subscribers service, which each subscription type represented as a separate endpoint.