Feature Idea: Performance monitoring for NodeJS GraphQL application

How can I gain more granular monitoring of my GraphQL NodeJS application?

We have written an NodeJS application that is using Apollo GraphQL server. We are running this app inside of a Docker container, and monitoring the application with New Relic APM NodeJS agent.

I am expecting to see more granular information about each GraphQL resolver, but APM is only displaying information at the top level endpoint (/graphql). This is not very helpful since there is a lot of logic in each resolver that I would like to monitor.

I assume there are ways to add custom NR instrumentation to my code with the NR NodeJS SDK, but I was hoping to get more monitoring out of the box for free (i.e. without instrumentation).

Apollo offers a product called Apollo Engine. This is a specialized solution for Apollo, and I am hoping to stay inside the NR ecosystem, as opposed to adding a separate monitoring solution.

It seems like GraphQL has gained significant adoption. (Netflix, Facebook, Atlassian, Contentful, Github, New Relic) I am surprised that New Relic has not added features specific for GraphQL to APM.

What options does New Relic APM offer for more granular monitoring of GraphQL?

New Relic Edit

  • I want this too
  • I have more info to share (reply below)
  • I have a solution for this

0 voters

We take feature ideas seriously and our product managers review every one when plotting their roadmaps. However, there is no guarantee this feature will be implemented. This post ensures the idea is put on the table and discussed though. So please vote and share your extra details with our team.


Hi there @dmiyamasu,

You’re correct - the answer here is definitely to make use of custom instrumentation:

I want to assure you that using the Custom Instrumentation is free money-wise (it makes use of our API) but it does require some extra work upfront. The reason for this is that one of the limitations of our agent is that we can only safely instrument a method we recognize as part of a known framework, i.e. methods that we have written instrumentation for. So, if your application is using an “unsupported” framework, you’ll almost certainly need to perform custom instrumentation to surface the transactions that you’re interested in. Custom instrumentation is just a way of extending the list of items that the agent recognizes out-of-the-box. Currently, we do not have any specific written instrumentation for Apollo or GraphQL. You can see the list of everything that we do currently instrument out of the box on our compatibility and requirements doc:

1 Like

@dmiyamasu - Thanks for sharing such a thorough use case with us. I want to be sure that the Node.js team sees your needs so I have passed along this post! Some of what you mentioned is not available out of the box. @palleman’s suggestion will get you far, and I have also created a Feature Request on your behalf to be sure your needs are heard by the broader New Relic team. :blush:

I have also added a poll above so that others in the community can vote on seeing more of the granular data you mentioned above. Thanks again and don’t forget to vote!

1 Like

Thank you @Linds & @palleman!

I am curious if you have contacts on the New Relic team who owns the New Relic GraphQL API? I’d love to hear how they chose to monitor their GraphQL application with New Relic APM.


Any input on this? I thought you might have some thoughts based on this article: https://blog.newrelic.com/engineering/graphql-api/

Hi, @dmiyamasu: @mweitzel and his team have been busy these past few months working on the New Relic programmability platform. He is in NYC this week, unveiling the platform at our FutureStack conference. Hopefully he will be able to help when he returns. Thanks for your patience!

Thanks @philweber
If @mweitzel is not the right person to contact on the NR GraphQL team, can you point me to someone else who may be able to share NR learnings on monitoring the NR GraphQL API?

He is the right person, he is just busy with new product launches at the moment. I am sure he will help as soon as he can.

Hi all,
is there any chance the agent will include GraphQL instrumentation OOB anytime soon?
Is there any example of custom instrumentation for GraphQL?

@dmiyamasu - I spoke with our GraphQL team who mentioned that they have instrumented GraphQL with Elixir, and our open source Elixir agent. Not via Apollo & Node.

@paolo.bianchi - I’m unsure of timelines - but the feature idea to have GraphQL instrumented out of the box is there - we’ll keep this thread up to date on any progress with that

1 Like

This is great! Thanks for sharing that solution @Ishpreet.Damir :smiley:

I’d like to “up vote” @paolo.bianchi ask about more GQL support OOB.
We’re currently beating our heads against the wall. NR is telling us we’ve got some Transactions that are horribly slow. But we have no visibility into the details… I can’t drill down into the specifics of the GQL requests that are slow

1 Like

https://deploy-preview-2008apollo-server-docs.netlify.com/docs/apollo-server/integrations/plugins/#plugin-event-reference … That link doesn’t appear to work

1 Like

Hey @ethiele - thanks for posting - I’ve added your +1 to a feature idea for native GQL support here. :slight_smile:

Thank you Ishpreet! I made some tweaks since rc.request.operationName logged IntrospectionQuery which isn’t very descriptive.

const newrelic = require(‘newrelic’)
const gqlTag = require(‘graphql-tag’)

const newRelicPlugin = {
requestDidStart(requestContext) {
return {
executionDidStart(rc) {
const obj = gqlTag(rc.request.query)
const operation = obj.definitions[0].operation
const resolverName = obj.definitions[0].selectionSet.selections[0].name.value
didEncounterErrors(rc) {


Nice! Thanks for sharing that @Jeanette.Fernandez

Hi @RyanVeitch, I’ve noticed that the transaction above is not monitoring database operations. Would using Knex to query the database cause issues?