@lightspeed/apollo-new-relic-extension
TypeScript icon, indicating that this package has built-in type declarations

0.1.12 • Public • Published

@lightspeed/apollo-new-relic-extension

npm version

Introduction

New Relic logging extension for GraphQL services. This extension will log all GraphQL transactions as New Relic transactions, providing insight into the operation query, an easily digestable time tracing summary, and a total error count.

Quick Start

  1. Install the dependency in your webapp.
yarn add newrelic @lightspeed/apollo-new-relic-extension
  1. Configure New Relic by either creating a newrelic.js configuration file at the root directory of your service, or setting environment variables as described here. You will at least need to set the app_name and license_key configurations.

  2. Add require('newrelic'); as the first line of your application's entry point. Modules syncronously loaded after New Relic will be instrumented appropriately.

  3. Enable the extension and tracing in your Apollo server configuration.

import ApolloNewRelicExtension from '@lightspeed/apollo-new-relic-extension';

// server.ts
const server = new ApolloServer({
  // ...
  extensions: [() => new ApolloNewRelicExtension()],
  tracing: true,
});

Readme

Keywords

none

Package Sidebar

Install

npm i @lightspeed/apollo-new-relic-extension

Weekly Downloads

57

Version

0.1.12

License

MIT

Unpacked Size

8.11 kB

Total Files

8

Last publish

Collaborators

  • kurt.bergeron
  • lightspeedhq
  • ls-guillaume-lambert
  • ls-frederic-bouchard
  • anomen