newrelic / gatsby-plugin-newrelic

A Gatsby plugin for instrumenting your site with New Relic's Browser Agent
https://opensource.newrelic.com/projects/newrelic/gatsby-plugin-newrelic
Apache License 2.0
8 stars 19 forks source link

New Relic Gatsby plugin seems to render "lite" snippet instead of "proAndSPA" #12

Closed jjunco-otf closed 4 years ago

jjunco-otf commented 4 years ago

Description

Using the New Relic Gatsby plugin, I have this in the Gatsby config:

{
  resolve: 'gatsby-plugin-newrelic',
  options: {
    instrumentationType: 'proAndSPA', // Options are 'lite', 'pro', 'proAndSPA'
    configs: {
        accountId: 'xxxxxxx',
        trustKey: 'xxxxxxx',
        agentID: 'xxxxxxx',
        licenseKey: 'xxxxxxx',
        applicationID: 'xxxxxxx',
        beacon: 'bam.nr-data.net',
        errorBeacon: 'bam.nr-data.net'
    }
  }
}

I configured the browser application like so:

image

Upon execution, the javascript snippet rendered is for "lite" instrumentation.

Expected Behaviour

Ability to view SPA-specific data in New Relic console.

Relevant Logs / Console output

I am told by a New Relic engineer that the above is not the correct snippet for "proAndSPA" instrumentation, although I have it configured that way..

Your Environment

MacOs Catalina 10.15.6 React v16.5.2 Gatsby v2.24.56 New Relic Gatsby plugin v1.03 Viewed on Chrome v85

Additional context

devfreddy commented 4 years ago

@jjunco-otf Thank you for the bug report.

I've identified a couple issues from our early implementation of this:

I've fixed/updated both of these in v1.0.4. If you update to the latest version of the plugin and take a look at the updated README for additional understanding/guidance, it should take care of your issue.

jjunco-otf commented 4 years ago

Awesome. The SPA snippet now shows. Thank you for the prompt fix.