0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-03-18 02:21:47 -05:00

Configured New Relic integration within Ghost core

refs https://github.com/TryGhost/DevOps/issues/66

- this allows us to enable New Relic within Ghost by providing some sane
  defaults
This commit is contained in:
Daniel Lockyer 2023-08-29 09:32:43 +02:00 committed by Daniel Lockyer
parent 0d0dc81299
commit e6ef88fc68
4 changed files with 1385 additions and 12 deletions

View file

@ -474,6 +474,14 @@ async function bootGhost({backend = true, frontend = true, server = true} = {})
try {
// Step 1 - require more fundamental components
// Load New Relic
debug('Begin: Load New Relic');
if (config.get('newRelic:enabled')) {
require('newrelic');
}
debug('End: Load New Relic');
// Sentry must be initialized early, but requires config
debug('Begin: Load sentry');
require('./shared/sentry');

53
ghost/core/newrelic.js Normal file
View file

@ -0,0 +1,53 @@
const config = require('./core/shared/config');
exports.config = {
app_name: ['Ghost'],
license_key: config.get('newRelic:licenseKey'),
labels: {
env: process.env.PRO_ENV || 'unknown',
site: config.get('hostSettings:siteId')
},
// Agent only imported when enabled, but this will further cement that
agent_enabled: config.get('newRelic:enabled'),
distributed_tracing: {
enabled: true
},
logging: {
level: 'info'
},
slow_sql: {
// Default is false.
enabled: true,
// Default is 10. Increasing this limit increases memory usage
// Defines the maximum number of slow queries the agent collects per minute.
// The agent discards additional queries after the limit is reached.
max_samples: 10
},
error_collector: {
ignore_classes: [
// @NOTE: add more error classes to ignore here
'ValidationError',
'NoPermissionError'
]
},
transaction_tracer: {
enabled: true,
record_sql: 'obfuscated'
},
allow_all_headers: true,
attributes: {
exclude: [
// Default exclusions (TODO: add more!):
'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*'
]
}
};

View file

@ -209,6 +209,7 @@
"multer": "1.4.4",
"mysql2": "3.5.2",
"nconf": "0.12.0",
"newrelic": "11.0.0",
"node-jose": "2.2.0",
"path-match": "1.2.4",
"probe-image-size": "7.2.3",

1335
yarn.lock

File diff suppressed because it is too large Load diff