Performance Monitoring Tool for Apollo Implementations of GraphQL
Features
Tracing chart for resolvers
Distribution bar chart
Line chart
Getting Started
To get resolver metrics for your GraphQL application, follow these easy steps.
npm
Install the arteMetrics node module into your project
npm install artemetrics
Installation
Head over to http://artemetrics.app and sign up to create a new app:
After signing up, create a new app by clicking on the App dropdown Once you name your new app, you will be redirected to a page containing a unique API key that you can inject into your own projectAfter copying the API key to your clipboard, paste it into a .env file
API_KEY = '45ed4db2-9ee5-4e30-a391-090a2c9cf0mg';
In your server file, require in our node module:
const arteMetrics = require('artemetrics');
And pass in your process.env.API_KEY into arteMetrics:
arteMetrics.setApiKey(process.env.API_KEY);
Then when you create an instance of ApolloServer, pass in a couple keys to the ApolloServer constructor:
const server = new ApolloServer({
typeDefs,
resolvers,
rootValue: (query) => {
arteMetrics.getName(query);
},
formatResponse: (response) => {
arteMetrics.process(response);
}
});
And then spin up your server
server.listen({ port: process.env.PORT || 4000 }).then(({ url }) => {
console.log(`🚀 app running at ${url}`);
});
And now if you head over to http://artemetrics.app and select your app, you should be able to see the queries you made through your application and track the duration of your resolvers
License
Distributed under the MIT License. MIT
Contributing
The team at arteMetrics would love contributions to this application! If there is something you would like to add, fork and clone this repo and make a PR!