This page provides instructions about transaction detection and configuration for the Node.js Agent.

GraphQL Business Transactions

GraphQL is a query and schema definition language that allows servers to expose an API over a HTTP endpoint. You specify the required data in the request payload and send all the requests from the client to a server endpoint. 

 AppDynamics supports GraphQL when used with the express-graphql module, view GraphQL HTTP Server Middleware.

  1. On the server side, you define a schema that describes the data and available operations on said data.
  2. Then, you invoke operations defined by the schema to retrieve data (through URL requests that receive GraphQL queries) and mutate it. 

In the current model, the Node.js Agent identifies an individual Business Transaction from the various requests coming to the server, but the agent does not capture the request payload. 

GraphQL Business Transactions determines the business transaction through the incoming endpoint and incoming GraphQL payload, allowing further visibility into the GraphQL Node.js applications. Every GraphQL query that matches this URL is aggregated into one Business Transaction. With GraphQL Business Transactions, the Node.js Agent can be configured in the Controller to identify if an incoming business transaction matches a specific URI (for example, starting with /QL) and split that transaction with an operation into multiple transactions.

By default, GraphQL Business Transactions is disabled. To configure the Node.js Agent to enable GraphQL Business Transactions, set enableGraphQL to true in the call to profile():

enableGraphQL: true,

Once GraphQL Business Transactions is enabled, you can configure a GraphQL custom match rule for a Node.js application: 

  1. In the Controller, select Configuration > Instrumentation > Transaction Detection
  2. Click Add Rule > Summary > Custom Match Rule
  3. Select Node.js in the Agent Type dropdown. Click Next.
  4. Enter a name for the match rule and ensure that the enabled checkbox is checked.
  5. Click Select Scope and select the desired scope for the rule. Click OK.
  6. Next, navigate to Rule Configuration > HTTP Request Match Criteria and click Add.

  7. Select URI as the criteria and choose the desired operation from the dropdown list. Then, enter the desired value for the GraphQL incantation (for example, the URL prefix).

  8. Navigate to Split Transactions Using Request Data and click the Split Transactions Using Request Data checkbox. 
  9. Select the graphql operation name from the dropdown and select Save
    Split Transaction Using Request Data

Upon configuring the rule and sending a GraphQL queries in your application, the Business Transactions page displays separate transactions.

GraphQL Business Transactions