1.0.2 • Published 2 years ago

@newrelic/netlify-plugin v1.0.2

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
2 years ago

New Relic Experimental header

New Relic Netlify Plugin GitHub GitHub issues GitHub pull requests GitHub last commit npm (scoped) npm npms.io (quality) Libraries.io dependency status for latest release, scoped npm package Lines of code

Monitor your Netlify build process and Jamstack application performance with New Relic, without the need for lengthy manual set up.

Built for developers who want to know how their deploys are impacting site performance for users, the New Relic Plugin for Netlify enables you to:

  • Automatically install the New Relic browser agent and notify New Relic each time a build event occurs in Netlify. Get critical insights via Real User Monitoring (RUM) into the performance of your Jamstack application.
  • Understand how each deploy impacts your site’s performance metrics in production.
  • Measure Google Core Web vitals on your site like Largest Contentful Paint, First Input Delay, and Cumulative Layout shift.
  • Quickly discover and fix errors before they impact your users.
  • Explore your data using our custom-built dashboards and receive alerts/notifications when there’s an issue with your Netlify site. Installing the New Relic Netlify Plugin

Installation

To install the plugin, log into your New Relic account (or sign up for a free account), then create a New Relic ingest license key and a New Relic browser ingest license key.

UI Installation

UI installation is the quickest way to start using the plugin, and does not require any modifications to your project's code.

File-based Installation

Alternatively, to install with file-based installation, add the following lines to your netlify.toml files:

package = "@newrelic/netlify-plugin"

  [plugins.inputs]
    newrelicAccountId = "123456"
    newrelicLicenseKey = "12345678901234567890"
    newrelicBrowserLicenseKey = "ABCD-0987654321"
    newrelicAppId = "123456789"
    enableBrowserMonitoring = true

Replace the values for newrelicAccountId, newrelicLicenseKey, newrelicBrowserLicenseKey, and newrelicAppId with your New Relic Account ID, the ingest and browser ingest license key you, and your New Relic Browser App ID.

Install the Netlify quickstart

To get the most out of your Netlify integration you should also install the New Relic Netlify quickstart. You can find more information on the quickstart page on New Relic I/O.

Settings

The plugin allows for customisation of the following settings via environment variables or your netlify.toml.

netlify.toml keyEnvironment variable nameDescriptionRequired forDefault value
failBuildOnPluginErrorFAIL_BUILD_ON_PLUGIN_ERRORFail the whole build if the plugin has an errortrue
newrelicAccountIdNEWRELIC_ACCOUNT_IDNew Relic Account IDevent tracking & browser monitoringundefined
newrelicLicenseKeyNEWRELIC_INGEST_LICENSE_KEYNew Relic Ingest License Keyevent trackingundefined
newrelicBrowserLicenseKeyNEWRELIC_BROWSER_LICENSE_KEYNew Relic Ingest License Keyevent trackingundefined
newrelicAppIdNEWRELIC_APP_IDNew Relic APM App IDbrowser monitoringundefined
recordEventsForPreviewsRECORD_EVENTS_FOR_PREVIEWSSet this to true if you want to record events for deploy previewsfalse
skipEvent.onPreBuildSKIP_PRE_BUILD_EVENTSet this to true to skip recording onPreBuild custom eventsfalse
skipEvent.onBuildSKIP_BUILD_EVENTSet this to true to skip recording onBuild custom eventsfalse
skipEvent.onPostBuildSKIP_POST_BUILD_EVENTSet this to true to skip recording onPostBuild custom eventsfalse
skipEvent.onSuccessSKIP_SUCCESS_EVENTSet this to true to skip recording onSuccess custom eventsfalse
skipEvent.onErrorSKIP_ERROR_EVENTSet this to true to skip recording onError custom eventsfalse
skipEvent.onEndSKIP_END_EVENTSet this to true to skip recording onEnd custom eventsfalse
enableBrowserMonitoringENABLE_BROWSER_MONITORINGAttempt to inject the browser monitor script tag into any HTML pagesfalse
enableBrowserMonitoringForPreviewsENABLE_BROWSER_MONITORING_FOR_PREVIEWSSet this to true if you want to enable browser monitoring for deploy previewsfalse
distributedTracingEnabledDISTRIBUTED_TRACING_ENABLEDEnable distributed tracing for browser requeststrue
cookiesEnabledCOOKIES_ENABLEDEnable cookies for browser monitoringtrue
htmlInjectionConcurrencyHTML_INJECTION_CONCURRENCYNumber of concurrently pending promises to use when injecting browser agent5
revisionTemplateREVISION_TEMPLATEDeploy marker revision and release version id structure (EJS string)<% if(git.commits0.message){ % ><%= git.commits0.message.slice(0,25) % >-<% } % ><%= process.env.CONTEXT % >-<%= process.env.COMMIT_REF.slice(0, 7) % >-<%= process.env.DEPLOY_ID.slice(-6) % >-<%= process.env.BUILD_ID.slice(-6) % >

Support

The plugin is part of New Relic experimental. The project is being developed in the open and we welcome all feedback and contributions.

Please raise an issue or contact us via the New Relic Explorers Hub.

Contributing

We encourage your contributions to improve the New Relic Netlify Plugin!

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 opensource@newrelic.com.

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

The New Relic Netlify plugin is licensed under the Apache 2.0 License.