AppSignal now offers Apollo Gateway support, giving you span-level gateway performance insights to enhance Apollo Gateway performance in your Node.js applications.
In this blog post, we'll give you a whistle-stop tour of how to instrument and monitor Apollo Gateway requests in your Node.js application.
Getting Started
AppSignal's Apollo Gateway support helps you:
- ✅ Identify expensive N+1 queries
- ✅ Analyze root spans
- ✅ Squash bugs in your gateway, subgraphs, and beyond
- ✅ Quickly analyze root spans to find and fix bottlenecks
You can instrument Apollo Gateway in just three simple steps:
1. Upgrade Your AppSignal Package
Ensure your Node.js application is using version 3.3.0
or higher of the AppSignal package.
For example, with npm:
npm update @appsignal/nodejs
Or with yarn:
yarn upgrade @appsignal/nodejs
2. Disable Gateway GraphQL Instrumentation
For the Apollo Gateway instrumentation to work, you first need to disable GraphQL in your gateway service. This enables the gateway to send its own @apollo/gateway OpenTelemetry spans.
To do so, use the disableDefaultInstrumentations
option in the AppSignal configuration:
3. Enable OpenTelemetry in the Apollo Gateway Config
To send @apollo/gateway OpenTelemetry spans to AppSignal, you need to enable telemetry in your Apollo Gateway config:
Monitoring Apollo Gateway With AppSignal
Let's say you're using Apollo Gateway to federate your Orders and Customers GraphQL servers:
What if we request the getAllOrders
query from our Apollo Gateway service? AppSignal will instrument the gateway request to the Orders
subgraph, giving you a high-level overview of how subgraphs in your gateway are performing:
At the same time, the query your gateway sends to the Orders
subgraph is also instrumented with AppSignal's out-of-the-box GraphQL. So you gain the same deep, subgraph-level insights into query performance.
AppSignal: The Node.js APM Tool
Node.js developers use AppSignal daily to monitor and enhance their Node.js applications, thanks to our:
- Intuitive interface that is easy to navigate.
- Simple and predictable pricing.
- Friendly developer-to-developer support.
New to AppSignal? With our installation wizard, we can have you up and monitoring within minutes. We'll even send you free delicious stroopwafels once you start sending us your app's metrics.
Simply start a free trial and join the thousands of developers relying on AppSignal to monitor and enhance their code today!