newrelic / newrelic-java-agent

The New Relic Java agent
Apache License 2.0
202 stars 144 forks source link

GraphQL Java queries not displayed as Web transactions/GraphQL transactions #1184

Open benoitcanton opened 1 year ago

benoitcanton commented 1 year ago

Description

When running a Spring application with GraphQL Java with the New Relic current agent download from https://download.newrelic.com/newrelic/java-agent/newrelic-agent/current GraphQL queries are not displayed as GraphQL transactions in the New Relic UI. They are shown as POST Spring transactions.

The Introspection queries are always displayed as expected as GraphQL transactions.

Expected Behavior

POST GraphQL queries should be displayed as Web transactions / GraphQL Transactions in New Relic UI

Troubleshooting or NR Diag results

The issue is only happening when using the New Relic agent JAR downloaded from the NR website or when using a release branch. An agent built from the main branch works as expected.

During testing/debugging I have made no changes to the Spring application itself.

Screenshot 2023-03-18 at 5 57 09 pm

Steps to Reproduce

(Not working) Current:

  1. Download current agent from https://download.newrelic.com/newrelic/java-agent/newrelic-agent/current
  2. Run application JAR with -javaagent:newrelic.jar
  3. GraphQL queries are shown as Web transactions / POST Spring Transactions in New Relic UI

(Not working) 8.0.1-release:

  1. Clone repo
  2. Checkout branch 8.0.1-release
  3. Run ./gradlew clean jar
  4. Run application JAR with -javaagent:newrelic.jar where newrelic.jar is the artifact newrelic-agent/build/newrelicJar/newrelic.jar
  5. GraphQL queries are shown as Web transactions / POST Spring Transactions in New Relic UI

(Working) main:

  1. Clone repo
  2. Checkout branch main
  3. Run ./gradlew clean jar
  4. Run application JAR with -javaagent:newrelic.jar where newrelic.jar is the artifact newrelic-agent/build/newrelicJar/newrelic.jar
  5. GraphQL queries are shown as Web transactions / GraphQL Transactions in New Relic UI

Your Environment

JDK 17 / Spring Webflux 5.3.24 / GraphQL Java 18.3

Additional context

workato-integration[bot] commented 1 year ago

https://issues.newrelic.com/browse/NEWRELIC-7647

kford-newrelic commented 1 year ago

@benoitcanton thanks for letting us know about this issue - we are reviewing internally

kford-newrelic commented 1 year ago

@benoitcanton could you clarify this for us:

Your description indicates that building from the main branch produces the expected transaction name and looking at the calendar, since you originally reported this we've released version 8.1.0 - can you confirm a) what is the behavior you see when you use the 8.1.0 jar downloaded from New Relic and b) what is the behavior you see when you build the agent from the 8.1.0 tag yourself?

Essentially, we want to rule in/out the possibility that there may have been a code change affecting this that you pulled down/built yourself and if so, that same code change may be in the 8.1.0 release (and hopefully you see the expected transaction name with that).