Monitor NR1 App with Browser Agent

Hi,

I’m attempting to install the New Relic Browser agent on a New Relic One application. I downloaded the agent script and uploaded in a publicly accessible S3 bucket and then tried to use the following to create the <script> tag in the <head> tag of the application:

 componentDidMount () {
    const script = document.createElement("script");
    script.src = 'https://url/to/browser-agent.js';
    script.type = 'text/javascript';
    document.head.appendChild(script);
  }

The app doesn’t throw any errors, but it doesn’t seem to successfully inject the script and no data is being reported. Any idea what I’m missing here?

I also tried directly inputting the script instead of getting it from a source, but that was also unsuccessful :frowning_face:

  componentDidMount () {
    const script = document.createElement('script');
    const scriptText = document.createTextNode(`super long agent script`);
    script.type = 'text/javascript';
    script.appendChild(scriptText);
    document.head.appendChild(script);
}

Hey @alex.plaza.gonzalez - As far as I know, it’s currently impossible to monitor Nerdpacks with the Browser agent.

This, essentially, is because there can’t be 2 agents sending NR data from the one source. All New Relic UI Pages have the browser agent running sending us data, so for now it’s not possible for NR customers to also monitor these pages.

I’d recommend posting over in the #full-stack-observability:browser space, where we will be able to file this as a feature request for you :smiley:

Thanks @RyanVeitc , will do. In the meantime, is there any New Relic product I can use to monitor a nerdpack app?

Edit: By the way, I opened another topic in the browser space as suggested.

Thanks for opening that topic. It looks like Holly has already gotten a feature idea filed for you on that thread.

As for other methods of monitoring NR1 Apps… I guess it depends on the kind of metrics you are looking for, but, an option you could try is to collect some metrics in the app code yourself, and send them to NR as events:

Which will allow you to NRQL query that data in the Chart Builder and build out a dashboard.

1 Like

Great suggestion. Thanks @RyanVeitch!

1 Like

Please do keep us updated! I’m excited to hear how this goes for you :smiley: