appsignal
AppSignal Now Automatically Instruments Apollo for Node.js Applications
Adam Yeats and Milica Maksimović on
We're happy to announce a new version of AppSignal for Node.js, and support for instrumenting Apollo Server v2+. This means that we'll save you more some time, and perform more automatic instrumentation for you.
What Automated Instrumentation Means
In order to understand which pieces of your code are causing performance problems, you'll need to add instrumentation to it. That way, you can break down all the actions and measure which ones are the slowest.
With AppSignal's automatic instrumentation, you don't need to do any manual work. Our agent detects parts of your infrastructure and automatically instruments it. We strive to provide you with as much out-of-the box functionality as possible, and spare you from doing any tedious manual tasks.
Since we use AppSignal to monitor AppSignal, we know exactly how it feels to be an AppSignal user, and which things usually get in our way. Customizing is amazing when you're an advanced user, but we also strive to amaze anyone who gives us a shot with a lot of out-of-the-box support.
What’s in This Integration?
The new integration for Apollo Server comes in the form of an Apollo Server plugin, that requires a little setup to get going. Here's how to get started:
Installation
First, [sign up for an AppSignal account][appsignal-sign-up] and add both the @appsignal/nodejs
and @appsignal/apollo-server
packages to your package.json
. Then, run yarn install
/npm install
.
You can also add these packages to your package.json
on the command line:
You can then import and use the package in your app.
Usage
The module includes an Apollo Server plugin for automatically instrumenting the resolvers of your application.
NOTE: You must define an operation name for your query to get an action name in the Performance view of AppSignal.com. For example,
query FetchData {}
would get the action nameFetchData
on AppSignal.com. If no operation name is set, the query will be grouped under the action name[unknown graphql query]
.
Ok, then what happens?
Once updated, you'll see your resolvers appear in the Event Timeline. You'll be able to see a breakdown of the time it took to parse, validate and execute your resolver:
You'll also be able to see the name and body of the operation when you hover over the resolvers execution phase:
This is great for those who wish to debug GraphQL queries that seem to take a long time, and you're not sure where the slowdown could be occurring. Don't forget about our anomaly triggers here also - these can be very useful for alerting when the query time reaches a certain threshold.
Try Out AppSignal and Get a Box of Stroopwafels 🍪
Hope we made you interested in getting more information about the performance of your app now! You can find more details about our support for Node.js here.
FYI, AppSignal is free for open source apps! For commercial apps, we suggest to hop on a trial, start pushing some data, and send us a message that you want some stroopwafels. We're shipping 🍪 worldwide 🌍