New Relic Netlify Plugin
Automatically track your builds, mark your deployments, and install the browser agent with this New Relic Netlify Plugin.
Features
- Custom events for
onPreBuild
,onBuild
,onPostBuild
,onSuccess
,onError
, andonEnd
- Create Deployment Markers after each build
- Add the New Relic browser monitor to all your static HTML pages
- Highly customizable!
Installation
Use file-based installation to install the plugin by modifying your netlify.toml
[[plugins]]
package = "@aaronbassett/newrelic-netlify-plugin"
Configuration
You can control much of the plugin's settings via environment variables or in your netlify.toml
.
[[plugins]]
package = "@aaronbassett/newrelic-netlify-plugin"
[plugins.inputs]
failBuildOnPluginError = false
newrelicAccountId = "123456"
newrelicLicenseKey = "12345678901234567890"
newrelicAppId = "123456789"
newrelicApiKey = "1234567890QWERTYUIOP"
newrelicBrowserLicenseKey = "POIU-0987654321"
enableBrowserMonitoring = true
[plugins.inputs.skipEvent]
onPreBuild = false
onBuild = false
onPostBuild = false
onEnd = false
Name | Description | Default Value |
---|---|---|
failBuildOnPluginError | Fail the whole build if the plugin has an error | true |
newrelicAccountId | New Relic Account ID (required for event tracking & browser monitoring) | undefined |
newrelicLicenseKey | New Relic Ingest License Key (required for event tracking) | undefined |
newrelicBrowserLicenseKey | New Relic Ingest License Key (required for event tracking) | undefined |
newrelicAppId | New Relic APM App ID (required for deployment marking & browser monitoring) | undefined |
newrelicApiKey | New Relic User Key (required for deployment marking) | undefined |
setDeploymentMarkers | Set this to to false to disable deployment marker creation | true |
setDeploymentMarkersForPreviews | Set this to true if you want to create deployment markers for deploy previews | false |
recordEventsForPreviews | Set this to true if you want to record events for deploy previews | false |
skipEvent.onPreBuild | Set this to true to skip recording onPreBuild custom events | false |
skipEvent.onBuild | Set this to true to skip recording onBuild custom events | false |
skipEvent.onPostBuild | Set this to true to skip recording onPostBuild custom events | false |
skipEvent.onSuccess | Set this to true to skip recording onSuccess custom events | false |
skipEvent.onError | Set this to true to skip recording onError custom events | false |
skipEvent.onEnd | Set this to true to skip recording onEnd custom events | false |
enableBrowserMonitoring | Attempt to inject the browser monitor script tag into any HTML pages | false |
enableBrowserMonitoringForPreviews | Set this to true if you want to enable browser monitoring for deploy previews | false |
distributedTracingEnabled | Enable distributed tracing for browser requests | true |
cookiesEnabled | Enable cookies for browser monitoring | true |
deployMarkerRevisionTemplate | eploy marker UUID structure (EJS string) | true |
Deployment Tracking
The plugin will automatically track each deployment in New Relic. It will also provide a detailed ChangeLog to help you see at a glance what has changed between deployments. Modify the deployMarkerRevisionTemplate
to change the revision UUID using EJS templates.
Custom Events
Track each successful build (and failure) with custom events.
Realtime Feedback in Netlify
Get a quick overview of the actions the plugin has performed, without ever leaving Netlify. Once a build has completed your deploy summary is populated.
Error Checking
The plugin can identify many common configuration problems, and provides you detailed information on what needs to be changed.