Michael George
Michael George

Reputation: 737

GraphQL Query resolvers as separate Web transactions

I have a Java Spring Boot service exposing GraphQL API. NewRelic identify all the queries as configuredGraphQLHttpServlet Web transaction as all of them are exposed via a single /graphql API . How can we track each GraphQL query resolver as different web transactions?

Upvotes: 3

Views: 577

Answers (2)

André Onuki
André Onuki

Reputation: 688

The New Relic Java agent starting with version 7.4.0 (Oct 2021) has auto-instrumentation for GraphQL. Use 7.4.3 or higher though.

With it the transactions are going to be named based on the query.

Check the documentation.

Upvotes: 2

Oscar Jiang
Oscar Jiang

Reputation: 305

You can use an AOP to set transaction name base on graphql method. It will look like below.

enter image description here

Upvotes: 0

Related Questions