- Install newrelic package for server-side APM - Create newrelic.js configuration with distributed tracing enabled - Update npm scripts to preload agent via -r flag for ES modules - Correlates with existing browser agent for end-to-end tracing Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
37 lines
877 B
JavaScript
37 lines
877 B
JavaScript
'use strict'
|
|
|
|
/**
|
|
* New Relic Node.js APM Configuration
|
|
*
|
|
* This file configures the New Relic agent for backend monitoring.
|
|
* Requires NEW_RELIC_LICENSE_KEY environment variable to be set.
|
|
*
|
|
* Distributed tracing is enabled to correlate with browser agent traces.
|
|
*/
|
|
|
|
exports.config = {
|
|
app_name: ['dasfad'],
|
|
license_key: process.env.NEW_RELIC_KEY,
|
|
distributed_tracing: {
|
|
enabled: true
|
|
},
|
|
logging: {
|
|
level: 'info'
|
|
},
|
|
allow_all_headers: true,
|
|
attributes: {
|
|
exclude: [
|
|
'request.headers.cookie',
|
|
'request.headers.authorization',
|
|
'request.headers.proxyAuthorization',
|
|
'request.headers.setCookie*',
|
|
'request.headers.x*',
|
|
'response.headers.cookie',
|
|
'response.headers.authorization',
|
|
'response.headers.proxyAuthorization',
|
|
'response.headers.setCookie*',
|
|
'response.headers.x*'
|
|
]
|
|
}
|
|
}
|