From 731d2e0b0d913caedf7a3c659b092a6e5adba76c Mon Sep 17 00:00:00 2001 From: Qin Guan Date: Tue, 30 Jan 2024 17:19:40 +0800 Subject: [PATCH] feat: add nr agent id config (#23) --- nuxt.config.ts | 1 + plugins/new-relic.ts | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/nuxt.config.ts b/nuxt.config.ts index dd6ec68..5529719 100644 --- a/nuxt.config.ts +++ b/nuxt.config.ts @@ -151,6 +151,7 @@ export default defineNuxtConfig({ }, newRelic: { + agentId: '' || process.env.NUXT_PUBLIC_NEW_RELIC_AGENT_ID, applicationId: '' || process.env.NUXT_PUBLIC_NEW_RELIC_APPLICATION_ID, }, }, diff --git a/plugins/new-relic.ts b/plugins/new-relic.ts index cd5dfe8..1a941a1 100644 --- a/plugins/new-relic.ts +++ b/plugins/new-relic.ts @@ -6,7 +6,7 @@ export default defineNuxtPlugin(() => { const options = { init: { distributed_tracing: { enabled: true }, privacy: { cookies_enabled: true }, ajax: { deny_list: ['bam.eu01.nr-data.net'] } }, info: { beacon: 'bam.eu01.nr-data.net', errorBeacon: 'bam.eu01.nr-data.net', licenseKey: 'NRJS-1b1f41c1d6baafe183c', applicationID: config.newRelic.applicationId, sa: 1 }, - loader_config: { accountID: '4337277', trustKey: '4337277', agentID: '538559409', licenseKey: 'NRJS-1b1f41c1d6baafe183c', applicationID: config.newRelic.applicationId }, + loader_config: { accountID: '4337277', trustKey: '4337277', agentID: config.newRelic.agentId, licenseKey: 'NRJS-1b1f41c1d6baafe183c', applicationID: config.newRelic.applicationId }, } const _ = new BrowserAgent(options)