It's hard to say without knowing exactly how you're using NestJS and GraphQL together, and without knowing which parts of Apollo Server that NestJS itself uses. Seeing a small sample of what I am using the graphql feature of nestjs means would be useful.
Here's a few datapoints that might help you narrow things down. Also, opening an issue in the Agent repository or a question in their forums might get more of the right eyes on this.
The Elastic APM instrumentation for Apollo Server works by wrapping the runHttpQuery
function of the apollo-server-core
module, and marking the transaction with trans._graphqlRoute
.
When the agent sees this _graphqlRoute
property, it runs some code that will set a default name for the transaction
if (trans._graphqlRoute) {
var name = queries.length > 0 ? queries.join(', ') : 'Unknown GraphQL query'
if (trans.req) var path = getPathFromRequest(trans.req, true)
var defaultName = name
defaultName = path ? defaultName + ' (' + path + ')' : defaultName
defaultName = operationName ? operationName + ' ' + defaultName : defaultName
trans.setDefaultName(defaultName)
trans.type = 'graphql'
}
In your application, either the _graphqlRoute
property isn't getting set, or the renaming code above is doing something weird, or something about NestJS comes along and renames the transaction after it's been named with the above code.
Knowing more specifically what you're doing would help folks narrow in on your problems.