how to setup newrelic in angular?

1.8k Views Asked by At

I'm trying to setup newrelic in my application using angular6 but I'm getting below error

"Cannot find name 'newrelic'". I included newrelic js file into index.html and I called 'newrelic.setCustomAttribute('useId',this.userId) on app.component.ts file

It is not recognize newrelic in angular.Please help me where I can include this newrelic file or setup steps

2

There are 2 best solutions below

0
On
0
On

Enable browser monitoring

Browser Pro+SPA is the default agent when you enable browser monitoring. This automatically gives you access to all of our browser monitoring features. For more information about the browser monitoring options, see Browser agent types in this document.

To enable browser monitoring:

Go to one.newrelic.com, click Add more data, then click Browser and mobile. Follow the instructions in the UI to select which data source for browser monitoring you want to use for your app, such as New Relic Browser. Generate some traffic for your app, then wait a few minutes for data to appear in New Relic. Optional: After installation is complete and you are seeing data, go to the App settings page for additional agent configuration, or to change the browser agent type. It may take several minutes after enabling the browser monitoring agent before your webpage data appear in New Relic. If have problems, follow our troubleshooting tips.

https://docs.newrelic.com/docs/browser/browser-monitoring/installation/install-browser-monitoring-agent