npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

gatsby-build-newrelic

v1.1.17

Published

[![New Relic Experimental header](https://github.com/newrelic/opensource-website/raw/master/src/images/categories/Experimental.png)](https://opensource.newrelic.com/oss-category/#new-relic-experimental)

Downloads

5,126

Readme

New Relic Experimental header

Gatsby Build Newrelic

Using Gatsby to deliver large websites can speed up end users’ experiences. However, as those projects scale, many development teams are slowed down by long build times. The gatsby-build-newrelic plugin provides instant observability into the entire Gatsby build process, exporting vital telemetry data from within the belly of the beast. With events, metrics, logs, and traces, we are able to contextualize and identify performance issues within our plugins, 3rd party APIs, and other parts of our website.

Getting Started

Account Setup and Required Variables

  1. If you don't already have a New Relic account, sign-up for our free forever tier - no credit-card required!

  2. Go to https://one.newrelic.com

  3. Select "Api Keys" from the Account Dropdown

  4. Your New Relic License Key should be listed here, just click on the settings icon and Copy Key lic-key

  5. Your Account Id should also be listed to the left of this. Save both of these for the configuration.

Installation

In your Gatsby project, depending on your package manager, run either:

npm i gatsby-build-newrelic

or

yarn add gatsby-build-newrelic

Build Command

Add the following to the gatsby build commands in your package.json:

 "gatsby build": "--open-tracing-config-file ./node_modules/gatsby-build-newrelic/zipkin-local.js --graphql-tracing",

If you are deploying to Gatsby Cloud you will also need to set the following environment variable, either in a .env file in your project or in your Gatsby Cloud Site Settings. See Managing Environment Variables in Gatsby Cloud:

GATSBY_OPEN_TRACING_CONFIG_FILE=node_modules/gatsby-build-newrelic/zipkin-local.js

Configuration

In gatsby-config.js, add the following code snippet to configure the plugin

{
  resolve: "gatsby-build-newrelic",
  options: {
    NR_LICENSE_KEY: "LICENSE KEY", // https://docs.newrelic.com/docs/apis/intro-apis/new-relic-api-keys/#ingest-license-key
    NR_ACCOUNT_ID: "Account Id",
    SITE_NAME: "your-website-name",
    collectTraces: true, // This will default to true so you can remove
    collectLogs: true, // This will default to true so you can remove
    collectMetrics: true, // This will default to true so you can remove
    customTags: { // Optional tags you would like to add to your data. For more info see https://docs.newrelic.com/docs/new-relic-one/use-new-relic-one/core-concepts/use-tags-help-organize-find-your-data/
      newFeature: 'remove-jank',
    }
  },
}

Required Fields

  • NR_LICENSE_KEY - Your New Relic License Key
  • NR_ACCOUNT_ID - Your New Relic Account Id
  • SITE_NAME - The name you want your app to appear under in New Relic

Optional Fields

collectTraces: Boolean - Whether to collect Trace data or not

  • Default: true
  • collectLogs: Boolean - Whether to collect Log events or not
    • Default: true
  • collectMetrics: Boolean - Whether to collect Metric data or not
    • Default: true
  • customTags: Object - Optional tags you would like to add to your data as key:value pairs. Read more here!

New Relic Only Fields

staging: Boolean - To report data to a New Relic Staging account

  • Default: false

Support

Please open an issue here in the GitHub Repo if you encounter any issues :D

Contributing

We encourage your contributions to improve Gatsby Build New Relic! Keep in mind when you submit your pull request, you'll need to sign the CLA via the click-through using CLA-Assistant. You only have to sign the CLA one time per project. If you have any questions, or to execute our corporate CLA, required if your contribution is on behalf of a company, please drop us an email at [email protected].

A note about vulnerabilities

As noted in our security policy, New Relic is committed to the privacy and security of our customers and their data. We believe that providing coordinated disclosure by security researchers and engaging with the security community are important means to achieve our security goals.

If you believe you have found a security vulnerability in this project or any of New Relic's products or websites, we welcome and greatly appreciate you reporting it to New Relic through HackerOne.

License

Gatsby Build New Relic is licensed under the Apache 2.0 License.