Reputation: 737
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
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
Reputation: 305
You can use an AOP to set transaction name base on graphql method. It will look like below.
Upvotes: 0