I am adding the elastic-apm-node package to our nestjs backend. I am using the graphql feature of nestjs. Because of this, all requests are merged together as /graphql
in elastic.
Is this how it is supposed to be? I imagined that since apollo-server-express is supported by elastic-apm-node, which is also used by nestjs, it should be displaying it better. Am I missing something?
UPDATE
The graphql feature is set up using the docs for nestjs: https://docs.nestjs.com/graphql/quick-start it is basically their recommended setup I am using.
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 theapollo-server-core
module, and marking the transaction withtrans._graphqlRoute
.When the agent sees this
_graphqlRoute
property, it runs some code that will set a default name for the transactionIn 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.