immersive2/newrelic.cjs
Michael Mainguy 421cd97fe9
All checks were successful
Build and Deploy / build (push) Successful in 1m47s
Add console log forwarding to New Relic and enable application logging
- Add console shim to forward log/error/warn/info to New Relic
- Enable application_logging with forwarding in newrelic.cjs
- Import newrelic in server.js for recordLogEvent API
- Update CI workflow with New Relic config

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-13 17:21:29 -06:00

49 lines
1.2 KiB
JavaScript

'use strict'
// Load .env.local first (has the secrets), then .env as fallback
require('dotenv').config({ path: '.env.local' });
require('dotenv').config();
/**
* 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-backend'],
license_key: process.env.NEW_RELIC_LICENSE_KEY,
distributed_tracing: {
enabled: true
},
logging: {
level: 'info'
},
application_logging: {
enabled: true,
forwarding: {
enabled: true,
max_samples_stored: 10000
},
local_decorating: {
enabled: true
}
},
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*'
]
}
}