@@ -4,6 +4,7 @@ import { OSFConfigService } from '@core/services/osf-config.service';
44
55import { ENVIRONMENT } from './environment.provider' ;
66
7+ import { BrowserAgent } from '@newrelic/browser-agent/loaders/browser-agent' ;
78import * as Sentry from '@sentry/angular' ;
89import { GoogleTagManagerConfiguration } from 'angular-google-tag-manager' ;
910
@@ -25,6 +26,7 @@ export function initializeApplication() {
2526 await configService . load ( ) ;
2627
2728 const googleTagManagerId = environment . googleTagManagerId ;
29+
2830 if ( googleTagManagerId ) {
2931 googleTagManagerConfiguration . set ( { id : googleTagManagerId } ) ;
3032 }
@@ -41,6 +43,33 @@ export function initializeApplication() {
4143 integrations : [ ] ,
4244 } ) ;
4345 }
46+
47+ if ( environment . newRelicEnabled ) {
48+ const newRelicConfig = {
49+ enabled : environment . newRelicEnabled ,
50+ init : {
51+ distributed_tracing : { enabled : environment . newRelicInitDistributedTracingEnabled } ,
52+ performance : { capture_measures : environment . newRelicInitPerformanceCaptureMeasures } ,
53+ privacy : { cookies_enabled : environment . newRelicInitPrivacyCookiesEnabled } ,
54+ ajax : { deny_list : environment . newRelicInitAjaxDenyList } ,
55+ } ,
56+ info : {
57+ beacon : environment . newRelicInfoBeacon ,
58+ errorBeacon : environment . newRelicInfoErrorBeacon ,
59+ licenseKey : environment . newRelicInfoLicenseKey ,
60+ applicationID : environment . newRelicInfoApplicationID ,
61+ sa : environment . newRelicInfoSa ,
62+ } ,
63+ loader_config : {
64+ accountID : environment . newRelicLoaderConfigAccountID ,
65+ trustKey : environment . newRelicLoaderConfigTrustKey ,
66+ agentID : environment . newRelicLoaderConfigAgengID ,
67+ licenseKey : environment . newRelicLoaderConfigLicenseKey ,
68+ applicationID : environment . newRelicLoaderConfigApplicationID ,
69+ } ,
70+ } ;
71+ new BrowserAgent ( newRelicConfig ) ;
72+ }
4473 } ;
4574}
4675
0 commit comments