Skip to content

Creating performance monitors for Apollo implementations of graphQL.

Notifications You must be signed in to change notification settings

oslabs-beta/arteMetrics

Repository files navigation

arteMetrics logo

Performance Monitoring Tool for Apollo Implementations of GraphQL

Features

Tracing chart for resolvers

Tracing chart

Distribution bar chart

distribution chart

Line 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:

creating new app

After signing up, create a new app by clicking on the App dropdown

naming new app

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 project

grabbing api key

After 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!

People

Sean Arseneault, Brian Chiang, Noah King, Joseph Renolayan,

About

Creating performance monitors for Apollo implementations of graphQL.

Resources

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •