diff --git a/docs/configuration.asciidoc b/docs/configuration.asciidoc index 2763baca79..9cd5001fcb 100644 --- a/docs/configuration.asciidoc +++ b/docs/configuration.asciidoc @@ -121,6 +121,18 @@ A boolean specifying if the agent should collect performance metrics for the app Note that both `active` and `instrument` needs to be `true` for instrumentation to be running. +[[central-config]] +==== `centralConfig` + +* *Type:* Boolean +* *Default:* `true` +* *Env:* `ELASTIC_APM_CENTRAL_CONFIG` + +Activate APM Agent Configuration via Kibana. +If set to `true`, the client will poll the APM Server regularly for new agent configuration. + +NOTE: This feature requires APM Server v7.3 or later and that the APM Server is configured with `kibana.enabled: true`. + [[async-hooks]] ==== `asyncHooks` diff --git a/docs/setup.asciidoc b/docs/setup.asciidoc index 0ff986f65e..e1cc06e289 100644 --- a/docs/setup.asciidoc +++ b/docs/setup.asciidoc @@ -51,12 +51,14 @@ NOTE: If you are using Babel, you need to use the `elastic-apm-node/start` appro There are three ways to configure the Node.js agent. In order of precedence (higher overwrites lower): -1. Environment variables. +1. APM Agent Configuration via Kibana. Enabled with <>. -2. If calling the `apm.start()` function, +2. Environment variables. + +3. If calling the `apm.start()` function, you can supply a <> as the first argument. -3. Via the <>. +4. Via the <>. For information on the available configuration properties, and the expected names of environment variables, see the <> documentation. diff --git a/index.d.ts b/index.d.ts index 1a7815c31b..830a8b164b 100644 --- a/index.d.ts +++ b/index.d.ts @@ -143,6 +143,7 @@ interface AgentConfigOptions { logger?: Logger; metricsInterval?: string; // Also support `number`, but as we're removing this functionality soon, there's no need to advertise it payloadLogFile?: string; + centralConfig?: boolean; secretToken?: string; serverTimeout?: string; // Also support `number`, but as we're removing this functionality soon, there's no need to advertise it serverUrl?: string; diff --git a/lib/config.js b/lib/config.js index 9fd194a506..21d11ce1e8 100644 --- a/lib/config.js +++ b/lib/config.js @@ -63,6 +63,7 @@ var DEFAULTS = { kubernetesPodUID: undefined, logLevel: 'info', metricsInterval: '30s', + centralConfig: true, serverTimeout: '30s', sourceLinesErrorAppFrames: 5, sourceLinesErrorLibraryFrames: 5, @@ -106,6 +107,7 @@ var ENV_TABLE = { logLevel: 'ELASTIC_APM_LOG_LEVEL', metricsInterval: 'ELASTIC_APM_METRICS_INTERVAL', payloadLogFile: 'ELASTIC_APM_PAYLOAD_LOG_FILE', + centralConfig: 'ELASTIC_APM_CENTRAL_CONFIG', secretToken: 'ELASTIC_APM_SECRET_TOKEN', serverTimeout: 'ELASTIC_APM_SERVER_TIMEOUT', serverUrl: 'ELASTIC_APM_SERVER_URL', @@ -122,6 +124,14 @@ var ENV_TABLE = { verifyServerCert: 'ELASTIC_APM_VERIFY_SERVER_CERT' } +var CENTRAL_CONFIG = { + transaction_sample_rate: 'transactionSampleRate' +} + +var VALIDATORS = { + transactionSampleRate: numberBetweenZeroAndOne +} + var BOOL_OPTS = [ 'active', 'asyncHooks', @@ -132,6 +142,7 @@ var BOOL_OPTS = [ 'errorOnAbortedRequests', 'filterHttpHeaders', 'instrument', + 'centralConfig', 'usePathAsTransactionName', 'verifyServerCert' ] @@ -172,116 +183,153 @@ var KEY_VALUE_OPTS = [ ] function config (opts) { - opts = Object.assign( - {}, - DEFAULTS, // default options - confFile, // options read from elastic-apm-node.js config file - opts, // options passed in to agent.start() - readEnv() // options read from environment variables - ) - - // Custom logic for setting serviceName so that an empty string in the config - // doesn't overwrite the serviceName read from package.json - if (!opts.serviceName) opts.serviceName = serviceName - if (!opts.serviceVersion) opts.serviceVersion = serviceVersion - - // NOTE: A logger will already exists if a custom logger was given to start() - if (typeof opts.logger === 'undefined') { - opts.logger = consoleLogLevel({ - level: opts.logLevel - }) - } - - normalizeIgnoreOptions(opts) - normalizeKeyValuePairs(opts) - normalizeNumbers(opts) - normalizeBytes(opts) - normalizeArrays(opts) - normalizeTime(opts) - normalizeBools(opts) - truncateOptions(opts) + return new Config(opts) +} - if (typeof opts.transport !== 'function') { - opts.transport = function httpTransport (conf, agent) { - var transport = new ElasticAPMHttpClient({ - // metadata - agentName: 'nodejs', - agentVersion: version, - serviceName: conf.serviceName, - serviceVersion: conf.serviceVersion, - frameworkName: conf.frameworkName, - frameworkVersion: conf.frameworkVersion, - globalLabels: maybePairsToObject(conf.globalLabels), - hostname: conf.hostname, - environment: conf.environment, - - // Sanitize conf - truncateKeywordsAt: config.INTAKE_STRING_MAX_SIZE, - truncateErrorMessagesAt: conf.errorMessageMaxLength, - - // HTTP conf - secretToken: conf.secretToken, - userAgent: userAgent, - serverUrl: conf.serverUrl, - rejectUnauthorized: conf.verifyServerCert, - serverTimeout: conf.serverTimeout * 1000, - - // Streaming conf - size: conf.apiRequestSize, - time: conf.apiRequestTime * 1000, - - // Debugging - payloadLogFile: conf.payloadLogFile, - - // Container conf - containerId: conf.containerId, - kubernetesNodeName: conf.kubernetesNodeName, - kubernetesNamespace: conf.kubernetesNamespace, - kubernetesPodName: conf.kubernetesPodName, - kubernetesPodUID: conf.kubernetesPodUID +class Config { + constructor (opts) { + this.ignoreUrlStr = [] + this.ignoreUrlRegExp = [] + this.ignoreUserAgentStr = [] + this.ignoreUserAgentRegExp = [] + + Object.assign( + this, + DEFAULTS, // default options + confFile, // options read from elastic-apm-node.js config file + opts, // options passed in to agent.start() + readEnv() // options read from environment variables + ) + + // Custom logic for setting serviceName so that an empty string in the config + // doesn't overwrite the serviceName read from package.json + if (!this.serviceName) this.serviceName = serviceName + if (!this.serviceVersion) this.serviceVersion = serviceVersion + + // NOTE: A logger will already exists if a custom logger was given to start() + if (typeof this.logger === 'undefined') { + this.logger = consoleLogLevel({ + level: this.logLevel }) + } - transport.on('error', err => { - agent.logger.error('APM Server transport error:', err.stack) - }) + normalize(this) + + if (typeof this.transport !== 'function') { + this.transport = function httpTransport (conf, agent) { + var transport = new ElasticAPMHttpClient({ + // metadata + agentName: 'nodejs', + agentVersion: version, + serviceName: conf.serviceName, + serviceVersion: conf.serviceVersion, + frameworkName: conf.frameworkName, + frameworkVersion: conf.frameworkVersion, + globalLabels: maybePairsToObject(conf.globalLabels), + hostname: conf.hostname, + environment: conf.environment, + + // Sanitize conf + truncateKeywordsAt: config.INTAKE_STRING_MAX_SIZE, + truncateErrorMessagesAt: conf.errorMessageMaxLength, + + // HTTP conf + secretToken: conf.secretToken, + userAgent: userAgent, + serverUrl: conf.serverUrl, + rejectUnauthorized: conf.verifyServerCert, + serverTimeout: conf.serverTimeout * 1000, + + // APM Agent Configuration via Kibana: + centralConfig: conf.centralConfig, + + // Streaming conf + size: conf.apiRequestSize, + time: conf.apiRequestTime * 1000, + + // Debugging + payloadLogFile: conf.payloadLogFile, + + // Container conf + containerId: conf.containerId, + kubernetesNodeName: conf.kubernetesNodeName, + kubernetesNamespace: conf.kubernetesNamespace, + kubernetesPodName: conf.kubernetesPodName, + kubernetesPodUID: conf.kubernetesPodUID + }) + + transport.on('config', remoteConf => { + const conf = {} + const unknown = [] + + for (const [key, value] of entries(remoteConf)) { + const newKey = CENTRAL_CONFIG[key] + if (newKey) { + conf[newKey] = value + } else { + unknown.push(key) + } + } - transport.on('request-error', err => { - const haveAccepted = Number.isFinite(err.accepted) - const haveErrors = Array.isArray(err.errors) - let msg - - if (err.code === 404) { - msg = 'APM Server responded with "404 Not Found". ' + - 'This might be because you\'re running an incompatible version of the APM Server. ' + - 'This agent only supports APM Server v6.5 and above. ' + - 'If you\'re using an older version of the APM Server, ' + - 'please downgrade this agent to version 1.x or upgrade the APM Server' - } else if (err.code) { - msg = `APM Server transport error (${err.code}): ${err.message}` - } else { - msg = `APM Server transport error: ${err.message}` - } - - if (haveAccepted || haveErrors) { - if (haveAccepted) msg += `\nAPM Server accepted ${err.accepted} events in the last request` - if (haveErrors) { - err.errors.forEach(error => { - msg += `\nError: ${error.message}` - if (error.document) msg += `\n Document: ${error.document}` - }) + if (unknown.length > 0) { + agent.logger.warn(`Remote config failure. Unsupported config names: ${unknown.join(', ')}`) } - } else if (err.response) { - msg += `\n${err.response}` - } - agent.logger.error(msg) - }) + if (Object.keys(conf).length > 0) { + normalize(conf, agent._conf) + + for (const [key, value] of entries(conf)) { + const validator = VALIDATORS[key] + if (validator ? validator(value) : true) { + agent.logger.info(`Remote config success. Updating ${key}: ${value}`) + agent._conf[key] = value + } else { + agent.logger.warn(`Remote config failure. Invalid value for ${key}: ${value}`) + } + } + } + }) + + transport.on('error', err => { + agent.logger.error('APM Server transport error:', err.stack) + }) + + transport.on('request-error', err => { + const haveAccepted = Number.isFinite(err.accepted) + const haveErrors = Array.isArray(err.errors) + let msg + + if (err.code === 404) { + msg = 'APM Server responded with "404 Not Found". ' + + 'This might be because you\'re running an incompatible version of the APM Server. ' + + 'This agent only supports APM Server v6.5 and above. ' + + 'If you\'re using an older version of the APM Server, ' + + 'please downgrade this agent to version 1.x or upgrade the APM Server' + } else if (err.code) { + msg = `APM Server transport error (${err.code}): ${err.message}` + } else { + msg = `APM Server transport error: ${err.message}` + } + + if (haveAccepted || haveErrors) { + if (haveAccepted) msg += `\nAPM Server accepted ${err.accepted} events in the last request` + if (haveErrors) { + err.errors.forEach(error => { + msg += `\nError: ${error.message}` + if (error.document) msg += `\n Document: ${error.document}` + }) + } + } else if (err.response) { + msg += `\n${err.response}` + } - return transport + agent.logger.error(msg) + }) + + return transport + } } } - - return opts } function readEnv () { @@ -300,12 +348,18 @@ function readEnv () { return opts } -function normalizeIgnoreOptions (opts) { - opts.ignoreUrlStr = [] - opts.ignoreUrlRegExp = [] - opts.ignoreUserAgentStr = [] - opts.ignoreUserAgentRegExp = [] +function normalize (opts) { + normalizeIgnoreOptions(opts) + normalizeKeyValuePairs(opts) + normalizeNumbers(opts) + normalizeBytes(opts) + normalizeArrays(opts) + normalizeTime(opts) + normalizeBools(opts) + truncateOptions(opts) +} +function normalizeIgnoreOptions (opts) { if (opts.ignoreUrls) { opts.ignoreUrls.forEach(function (ptn) { if (typeof ptn === 'string') opts.ignoreUrlStr.push(ptn) @@ -459,3 +513,7 @@ function pairsToObject (pairs) { return object }, {}) } + +function numberBetweenZeroAndOne (n) { + return n >= 0 && n <= 1 +} diff --git a/package.json b/package.json index 79b5525fab..8364537e90 100644 --- a/package.json +++ b/package.json @@ -79,7 +79,7 @@ "console-log-level": "^1.4.0", "cookie": "^0.4.0", "core-util-is": "^1.0.2", - "elastic-apm-http-client": "^8.0.0", + "elastic-apm-http-client": "^8.1.0", "end-of-stream": "^1.4.1", "fast-safe-stringify": "^2.0.6", "http-headers": "^3.0.2", diff --git a/test/_agent.js b/test/_agent.js index 6a9678b0b4..ea36303add 100644 --- a/test/_agent.js +++ b/test/_agent.js @@ -29,5 +29,9 @@ function clean () { agent._instrumentation._hook.unhook() } agent._metrics.stop() + if (agent._transport && agent._transport.destroy) { + agent._transport.destroy() + } + agent._transport = null } } diff --git a/test/_apm_server.js b/test/_apm_server.js index 2de00507ee..2c0732e636 100644 --- a/test/_apm_server.js +++ b/test/_apm_server.js @@ -14,6 +14,7 @@ var Agent = require('./_agent') var defaultAgentOpts = { serviceName: 'some-service-name', captureExceptions: false, + centralConfig: false, logLevel: 'error' } diff --git a/test/agent.js b/test/agent.js index c85fbd5e78..e2efd38b47 100644 --- a/test/agent.js +++ b/test/agent.js @@ -16,6 +16,7 @@ var agentVersion = require('../package.json').version var inContainer = 'containerId' in (containerInfo() || {}) process.env.ELASTIC_APM_METRICS_INTERVAL = '0' +process.env.ELASTIC_APM_CENTRAL_CONFIG = 'false' test('#setFramework()', function (t) { var agent = Agent() diff --git a/test/babel/src.js b/test/babel/src.js index 191c0ccba2..74ffd33d5d 100644 --- a/test/babel/src.js +++ b/test/babel/src.js @@ -4,5 +4,6 @@ import agent from '../../' agent.start({ captureExceptions: false, - metricsInterval: '0' + metricsInterval: '0', + centralConfig: false }) diff --git a/test/central-config-disabled.js b/test/central-config-disabled.js new file mode 100644 index 0000000000..192d4568ec --- /dev/null +++ b/test/central-config-disabled.js @@ -0,0 +1,35 @@ +'use strict' + +const existingValue = process.env.ELASTIC_APM_CENTRAL_CONFIG +delete process.env.ELASTIC_APM_CENTRAL_CONFIG + +const http = require('http') + +const test = require('tape') + +test('central config disabled', function (t) { + const server = http.createServer((req, res) => { + t.notOk(req.url.startsWith('/config/v1/agents'), `should not poll APM Server for config (url: ${req.url})`) + }) + + server.listen(function () { + const agent = require('..').start({ + serverUrl: 'http://localhost:' + server.address().port, + serviceName: 'test', + captureExceptions: false, + metricsInterval: 0, + centralConfig: false + }) + + setTimeout(function () { + t.pass('should not poll APM Server for config') + t.end() + agent.destroy() + server.close() + }, 1000) + }) + + t.on('end', function () { + if (existingValue) process.env.ELASTIC_APM_CENTRAL_CONFIG = existingValue + }) +}) diff --git a/test/central-config-enabled.js b/test/central-config-enabled.js new file mode 100644 index 0000000000..bd2edaa98b --- /dev/null +++ b/test/central-config-enabled.js @@ -0,0 +1,57 @@ +'use strict' + +const existingValue = process.env.ELASTIC_APM_CENTRAL_CONFIG +delete process.env.ELASTIC_APM_CENTRAL_CONFIG + +const parseUrl = require('url').parse +const http = require('http') + +const test = require('tape') + +test('remote config enabled', function (t) { + t.plan(2) + + let agent, timer + const server = http.createServer((req, res) => { + const url = parseUrl(req.url, { parseQueryString: true }) + t.equal(url.pathname, '/config/v1/agents') + res.writeHead(200, { + Etag: 1, + 'Cache-Control': 'max-age=30, must-revalidate' + }) + res.end(JSON.stringify({ + transaction_sample_rate: 0.42 + })) + clearTimeout(timer) + agent.destroy() + server.close() + }) + + server.listen(function () { + agent = require('..').start({ + serverUrl: 'http://localhost:' + server.address().port, + serviceName: 'test', + captureExceptions: false, + metricsInterval: 0, + centralConfig: true + }) + + Object.defineProperty(agent._conf, 'transactionSampleRate', { + set (value) { + t.equal(value, 0.42) + t.end() + }, + get () {}, + enumerable: true, + configurable: true + }) + + timer = setTimeout(function () { + t.fail('should poll APM Server for config') + }, 1000) + }) + + t.on('end', function () { + if (existingValue) process.env.ELASTIC_APM_CENTRAL_CONFIG = existingValue + }) +}) diff --git a/test/config.js b/test/config.js index a7b1760b4c..603d9a49b1 100644 --- a/test/config.js +++ b/test/config.js @@ -23,46 +23,49 @@ var apmVersion = require('../package').version var apmName = require('../package').name process.env.ELASTIC_APM_METRICS_INTERVAL = '0' +process.env.ELASTIC_APM_CENTRAL_CONFIG = 'false' var optionFixtures = [ - ['serviceName', 'SERVICE_NAME', apmName], - ['secretToken', 'SECRET_TOKEN'], - ['serverUrl', 'SERVER_URL'], - ['verifyServerCert', 'VERIFY_SERVER_CERT', true], - ['serviceVersion', 'SERVICE_VERSION', apmVersion], + ['abortedErrorThreshold', 'ABORTED_ERROR_THRESHOLD', 25], ['active', 'ACTIVE', true], - ['logLevel', 'LOG_LEVEL', 'info'], - ['hostname', 'HOSTNAME'], ['apiRequestSize', 'API_REQUEST_SIZE', 768 * 1024], ['apiRequestTime', 'API_REQUEST_TIME', 10], - ['frameworkName', 'FRAMEWORK_NAME'], - ['frameworkVersion', 'FRAMEWORK_VERSION'], - ['stackTraceLimit', 'STACK_TRACE_LIMIT', 50], - ['captureExceptions', 'CAPTURE_EXCEPTIONS', true], - ['filterHttpHeaders', 'FILTER_HTTP_HEADERS', true], + ['asyncHooks', 'ASYNC_HOOKS', true], + ['captureBody', 'CAPTURE_BODY', 'off'], ['captureErrorLogStackTraces', 'CAPTURE_ERROR_LOG_STACK_TRACES', config.CAPTURE_ERROR_LOG_STACK_TRACES_MESSAGES], + ['captureExceptions', 'CAPTURE_EXCEPTIONS', true], ['captureSpanStackTraces', 'CAPTURE_SPAN_STACK_TRACES', true], - ['captureBody', 'CAPTURE_BODY', 'off'], + ['centralConfig', 'CENTRAL_CONFIG', true], + ['containerId', 'CONTAINER_ID'], + ['disableInstrumentations', 'DISABLE_INSTRUMENTATIONS', []], + ['environment', 'ENVIRONMENT', 'development'], + ['errorMessageMaxLength', 'ERROR_MESSAGE_MAX_LENGTH', 2048], ['errorOnAbortedRequests', 'ERROR_ON_ABORTED_REQUESTS', false], - ['abortedErrorThreshold', 'ABORTED_ERROR_THRESHOLD', 25], + ['filterHttpHeaders', 'FILTER_HTTP_HEADERS', true], + ['frameworkName', 'FRAMEWORK_NAME'], + ['frameworkVersion', 'FRAMEWORK_VERSION'], + ['hostname', 'HOSTNAME'], ['instrument', 'INSTRUMENT', true], - ['asyncHooks', 'ASYNC_HOOKS', true], + ['kubernetesNamespace', 'KUBERNETES_NAMESPACE'], + ['kubernetesNodeName', 'KUBERNETES_NODE_NAME'], + ['kubernetesPodName', 'KUBERNETES_POD_NAME'], + ['kubernetesPodUID', 'KUBERNETES_POD_UID'], + ['logLevel', 'LOG_LEVEL', 'info'], + ['metricsInterval', 'METRICS_INTERVAL', 30], + ['secretToken', 'SECRET_TOKEN'], + ['serverTimeout', 'SERVER_TIMEOUT', 30], + ['serverUrl', 'SERVER_URL'], + ['serviceName', 'SERVICE_NAME', apmName], + ['serviceVersion', 'SERVICE_VERSION', apmVersion], ['sourceLinesErrorAppFrames', 'SOURCE_LINES_ERROR_APP_FRAMES', 5], ['sourceLinesErrorLibraryFrames', 'SOURCE_LINES_ERROR_LIBRARY_FRAMES', 5], ['sourceLinesSpanAppFrames', 'SOURCE_LINES_SPAN_APP_FRAMES', 0], ['sourceLinesSpanLibraryFrames', 'SOURCE_LINES_SPAN_LIBRARY_FRAMES', 0], - ['errorMessageMaxLength', 'ERROR_MESSAGE_MAX_LENGTH', 2048], + ['stackTraceLimit', 'STACK_TRACE_LIMIT', 50], ['transactionMaxSpans', 'TRANSACTION_MAX_SPANS', 500], ['transactionSampleRate', 'TRANSACTION_SAMPLE_RATE', 1.0], - ['serverTimeout', 'SERVER_TIMEOUT', 30], - ['disableInstrumentations', 'DISABLE_INSTRUMENTATIONS', []], - ['containerId', 'CONTAINER_ID'], - ['kubernetesNodeName', 'KUBERNETES_NODE_NAME'], - ['kubernetesNamespace', 'KUBERNETES_NAMESPACE'], - ['kubernetesPodName', 'KUBERNETES_POD_NAME'], - ['kubernetesPodUID', 'KUBERNETES_POD_UID'], ['usePathAsTransactionName', 'USE_PATH_AS_TRANSACTION_NAME', false], - ['environment', 'ENVIRONMENT', 'development'] + ['verifyServerCert', 'VERIFY_SERVER_CERT', true] ] var falsyValues = [false, 'false'] @@ -74,8 +77,10 @@ optionFixtures.forEach(function (fixture) { var url = fixture[0] === 'serverUrl' // special case for url's so they can be parsed using url.parse() var number = typeof fixture[2] === 'number' var array = Array.isArray(fixture[2]) + var envName = 'ELASTIC_APM_' + fixture[1] + var existingValue = process.env[envName] - test('should be configurable by environment variable ELASTIC_APM_' + fixture[1], function (t) { + test(`should be configurable by environment variable ${envName}`, function (t) { var agent = Agent() var value @@ -84,7 +89,7 @@ optionFixtures.forEach(function (fixture) { else if (url) value = 'http://custom-value' else value = 'custom-value' - process.env['ELASTIC_APM_' + fixture[1]] = value.toString() + process.env[envName] = value.toString() agent.start() @@ -94,12 +99,16 @@ optionFixtures.forEach(function (fixture) { t.equal(agent._conf[fixture[0]], bool ? !fixture[2] : value) } - delete process.env['ELASTIC_APM_' + fixture[1]] + if (existingValue) { + process.env[envName] = existingValue + } else { + delete process.env[envName] + } t.end() }) - test('should overwrite option property ' + fixture[0] + ' by ELASTIC_APM_' + fixture[1], function (t) { + test(`should overwrite option property ${fixture[0]} by ${envName}`, function (t) { var agent = Agent() var opts = {} var value1, value2 @@ -119,7 +128,7 @@ optionFixtures.forEach(function (fixture) { } opts[fixture[0]] = value1 - process.env['ELASTIC_APM_' + fixture[1]] = value2.toString() + process.env[envName] = value2.toString() agent.start(opts) @@ -129,13 +138,21 @@ optionFixtures.forEach(function (fixture) { t.equal(agent._conf[fixture[0]], value2) } - delete process.env['ELASTIC_APM_' + fixture[1]] + if (existingValue) { + process.env[envName] = existingValue + } else { + delete process.env[envName] + } t.end() }) } test('should default ' + fixture[0] + ' to ' + fixture[2], function (t) { + if (existingValue) { + delete process.env[envName] + } + var agent = Agent() agent.start() if (array) { @@ -143,6 +160,11 @@ optionFixtures.forEach(function (fixture) { } else { t.equal(agent._conf[fixture[0]], fixture[2]) } + + if (existingValue) { + process.env[envName] = existingValue + } + t.end() }) }) @@ -638,8 +660,7 @@ test('disableInstrumentations', function (t) { agent.start({ serviceName: 'service', disableInstrumentations: selection, - captureExceptions: false, - metricsInterval: 0 + captureExceptions: false }) var found = new Set() @@ -678,7 +699,6 @@ test('custom transport', function (t) { var agent = Agent() agent.start({ captureExceptions: false, - metricsInterval: 0, serviceName: 'fooBAR0123456789_- ', transport () { var transactions = [] @@ -742,8 +762,7 @@ test('addPatch', function (t) { const agent = Agent() agent.start({ addPatch: 'express=./test/_patch.js', - captureExceptions: false, - metricsInterval: 0 + captureExceptions: false }) t.deepEqual(require('express'), patch(before)) @@ -755,10 +774,7 @@ test('globalLabels should be received by transport', function (t) { var globalLabels = { foo: 'bar' } - var opts = { - metricsInterval: 0, - globalLabels - } + var opts = { globalLabels } var server = APMServer(opts, { expect: 'error' }) .on('listening', function () { diff --git a/test/instrumentation/_agent.js b/test/instrumentation/_agent.js index b6c81a39c6..810a619148 100644 --- a/test/instrumentation/_agent.js +++ b/test/instrumentation/_agent.js @@ -30,7 +30,8 @@ module.exports = function mockAgent (expected, cb) { transactionSampleRate: 1.0, disableInstrumentations: [], captureHeaders: true, - metricsInterval: 0 + metricsInterval: 0, + centralConfig: false }, _errorFilters: new Filters(), _transactionFilters: new Filters(), diff --git a/test/instrumentation/modules/apollo-server-express.js b/test/instrumentation/modules/apollo-server-express.js index 4045164993..091553dc31 100644 --- a/test/instrumentation/modules/apollo-server-express.js +++ b/test/instrumentation/modules/apollo-server-express.js @@ -4,7 +4,8 @@ var agent = require('../../..').start({ serviceName: 'test', secretToken: 'test', captureExceptions: false, - metricsInterval: 0 + metricsInterval: 0, + centralConfig: false }) var semver = require('semver') diff --git a/test/instrumentation/modules/bluebird/bluebird.js b/test/instrumentation/modules/bluebird/bluebird.js index cb05118aef..a1122c5f97 100644 --- a/test/instrumentation/modules/bluebird/bluebird.js +++ b/test/instrumentation/modules/bluebird/bluebird.js @@ -4,7 +4,8 @@ var agent = require('../../../..').start({ serviceName: 'test', secretToken: 'test', captureExceptions: false, - metricsInterval: 0 + metricsInterval: 0, + centralConfig: false }) var BLUEBIRD_VERSION = require('bluebird/package').version diff --git a/test/instrumentation/modules/bluebird/cancel.js b/test/instrumentation/modules/bluebird/cancel.js index b2f8a19c64..8ee5b04e74 100644 --- a/test/instrumentation/modules/bluebird/cancel.js +++ b/test/instrumentation/modules/bluebird/cancel.js @@ -4,7 +4,8 @@ var agent = require('../../../..').start({ serviceName: 'test', secretToken: 'test', captureExceptions: false, - metricsInterval: 0 + metricsInterval: 0, + centralConfig: false }) var BLUEBIRD_VERSION = require('bluebird/package').version diff --git a/test/instrumentation/modules/cassandra-driver/index.js b/test/instrumentation/modules/cassandra-driver/index.js index e47b995b8c..a817609521 100644 --- a/test/instrumentation/modules/cassandra-driver/index.js +++ b/test/instrumentation/modules/cassandra-driver/index.js @@ -4,7 +4,8 @@ const agent = require('../../../..').start({ serviceName: 'test', secretToken: 'test', captureExceptions: false, - metricsInterval: 0 + metricsInterval: 0, + centralConfig: false }) const semver = require('semver') diff --git a/test/instrumentation/modules/elasticsearch.js b/test/instrumentation/modules/elasticsearch.js index 07e138cfe1..5b6f1deafa 100644 --- a/test/instrumentation/modules/elasticsearch.js +++ b/test/instrumentation/modules/elasticsearch.js @@ -7,7 +7,8 @@ var agent = require('../../..').start({ serviceName: 'test', secretToken: 'test', captureExceptions: false, - metricsInterval: 0 + metricsInterval: 0, + centralConfig: false }) var elasticsearch = require('elasticsearch') diff --git a/test/instrumentation/modules/express-graphql.js b/test/instrumentation/modules/express-graphql.js index bae0d86aed..1d6f305d5a 100644 --- a/test/instrumentation/modules/express-graphql.js +++ b/test/instrumentation/modules/express-graphql.js @@ -4,7 +4,8 @@ var agent = require('../../..').start({ serviceName: 'test', secretToken: 'test', captureExceptions: false, - metricsInterval: 0 + metricsInterval: 0, + centralConfig: false }) var http = require('http') diff --git a/test/instrumentation/modules/express-queue.js b/test/instrumentation/modules/express-queue.js index 4fe897443e..b45504c236 100644 --- a/test/instrumentation/modules/express-queue.js +++ b/test/instrumentation/modules/express-queue.js @@ -4,7 +4,8 @@ var agent = require('../../..').start({ serviceName: 'test', secretToken: 'test', captureExceptions: false, - metricsInterval: 0 + metricsInterval: 0, + centralConfig: false }) var semver = require('semver') diff --git a/test/instrumentation/modules/express/basic.js b/test/instrumentation/modules/express/basic.js index f7ed934f97..71468ca6c7 100644 --- a/test/instrumentation/modules/express/basic.js +++ b/test/instrumentation/modules/express/basic.js @@ -4,7 +4,8 @@ var agent = require('../../../..').start({ serviceName: 'test', secretToken: 'test', captureExceptions: true, - metricsInterval: 0 + metricsInterval: 0, + centralConfig: false }) var http = require('http') diff --git a/test/instrumentation/modules/express/capture-exceptions-off.js b/test/instrumentation/modules/express/capture-exceptions-off.js index 125fec86d1..8d00a15ba1 100644 --- a/test/instrumentation/modules/express/capture-exceptions-off.js +++ b/test/instrumentation/modules/express/capture-exceptions-off.js @@ -2,7 +2,8 @@ const agent = require('../../../..').start({ captureExceptions: false, - metricsInterval: 0 + metricsInterval: 0, + centralConfig: false }) const { exec } = require('child_process') diff --git a/test/instrumentation/modules/express/capture-exceptions-on.js b/test/instrumentation/modules/express/capture-exceptions-on.js index b9b519cfef..7afcf61ce9 100644 --- a/test/instrumentation/modules/express/capture-exceptions-on.js +++ b/test/instrumentation/modules/express/capture-exceptions-on.js @@ -2,7 +2,8 @@ const agent = require('../../../..').start({ captureExceptions: true, - metricsInterval: 0 + metricsInterval: 0, + centralConfig: false }) const { exec } = require('child_process') diff --git a/test/instrumentation/modules/express/set-framework.js b/test/instrumentation/modules/express/set-framework.js index bd68b1205c..66504c1c9e 100644 --- a/test/instrumentation/modules/express/set-framework.js +++ b/test/instrumentation/modules/express/set-framework.js @@ -2,7 +2,8 @@ const agent = require('../../../..').start({ captureExceptions: true, - metricsInterval: 0 + metricsInterval: 0, + centralConfig: false }) let asserts = 0 diff --git a/test/instrumentation/modules/fastify/async-await.js b/test/instrumentation/modules/fastify/async-await.js index 80ac6d903f..a9fec546b1 100644 --- a/test/instrumentation/modules/fastify/async-await.js +++ b/test/instrumentation/modules/fastify/async-await.js @@ -2,7 +2,8 @@ require('../../../..').start({ captureExceptions: false, - metricsInterval: 0 + metricsInterval: 0, + centralConfig: false }) // Only Node.js v7.6.0+ supports async/await without a flag diff --git a/test/instrumentation/modules/fastify/fastify.js b/test/instrumentation/modules/fastify/fastify.js index 94997a66f9..aa13981971 100644 --- a/test/instrumentation/modules/fastify/fastify.js +++ b/test/instrumentation/modules/fastify/fastify.js @@ -2,7 +2,8 @@ const agent = require('../../../..').start({ captureExceptions: false, - metricsInterval: 0 + metricsInterval: 0, + centralConfig: false }) { diff --git a/test/instrumentation/modules/fastify/set-framework.js b/test/instrumentation/modules/fastify/set-framework.js index 51a28724af..de96a33255 100644 --- a/test/instrumentation/modules/fastify/set-framework.js +++ b/test/instrumentation/modules/fastify/set-framework.js @@ -2,7 +2,8 @@ const agent = require('../../../..').start({ captureExceptions: true, - metricsInterval: 0 + metricsInterval: 0, + centralConfig: false }) let asserts = 0 diff --git a/test/instrumentation/modules/finalhandler.js b/test/instrumentation/modules/finalhandler.js index 08869b2134..9d2ad55c48 100644 --- a/test/instrumentation/modules/finalhandler.js +++ b/test/instrumentation/modules/finalhandler.js @@ -4,7 +4,8 @@ var agent = require('../../..').start({ serviceName: 'test', secretToken: 'test', captureExceptions: true, - metricsInterval: 0 + metricsInterval: 0, + centralConfig: false }) var http = require('http') diff --git a/test/instrumentation/modules/generic-pool.js b/test/instrumentation/modules/generic-pool.js index 1575bba98f..db281d64ab 100644 --- a/test/instrumentation/modules/generic-pool.js +++ b/test/instrumentation/modules/generic-pool.js @@ -4,7 +4,8 @@ var agent = require('../../..').start({ serviceName: 'test', secretToken: 'test', captureExceptions: false, - metricsInterval: 0 + metricsInterval: 0, + centralConfig: false }) var genericPool = require('generic-pool') diff --git a/test/instrumentation/modules/graphql.js b/test/instrumentation/modules/graphql.js index e16e46c3ea..30112658fe 100644 --- a/test/instrumentation/modules/graphql.js +++ b/test/instrumentation/modules/graphql.js @@ -4,7 +4,8 @@ var agent = require('../../..').start({ serviceName: 'test', secretToken: 'test', captureExceptions: false, - metricsInterval: 0 + metricsInterval: 0, + centralConfig: false }) var graphql = require('graphql') diff --git a/test/instrumentation/modules/handlebars.js b/test/instrumentation/modules/handlebars.js index 9767021f08..90506bf91c 100644 --- a/test/instrumentation/modules/handlebars.js +++ b/test/instrumentation/modules/handlebars.js @@ -6,7 +6,8 @@ var agent = require('../../..').start({ serviceName: 'test', secretToken: 'test', captureExceptions: false, - metricsInterval: 0 + metricsInterval: 0, + centralConfig: false }) var handlebars = require('handlebars') diff --git a/test/instrumentation/modules/hapi/basic.js b/test/instrumentation/modules/hapi/basic.js index 88470b8c9a..da314cb350 100644 --- a/test/instrumentation/modules/hapi/basic.js +++ b/test/instrumentation/modules/hapi/basic.js @@ -5,7 +5,8 @@ var agent = require('../../../..').start({ secretToken: 'test', captureExceptions: false, logLevel: 'fatal', - metricsInterval: 0 + metricsInterval: 0, + centralConfig: false }) var pkg = require('hapi/package.json') diff --git a/test/instrumentation/modules/hapi/set-framework.js b/test/instrumentation/modules/hapi/set-framework.js index ab91dd6cea..1aaecf8bc6 100644 --- a/test/instrumentation/modules/hapi/set-framework.js +++ b/test/instrumentation/modules/hapi/set-framework.js @@ -2,7 +2,8 @@ const agent = require('../../../..').start({ captureExceptions: true, - metricsInterval: 0 + metricsInterval: 0, + centralConfig: false }) const pkg = require('hapi/package') diff --git a/test/instrumentation/modules/http/aws.js b/test/instrumentation/modules/http/aws.js index 689b3cd6b2..0420578ad7 100644 --- a/test/instrumentation/modules/http/aws.js +++ b/test/instrumentation/modules/http/aws.js @@ -2,7 +2,8 @@ const agent = require('../../../..').start({ captureExceptions: false, - metricsInterval: 0 + metricsInterval: 0, + centralConfig: false }) const http = require('http') diff --git a/test/instrumentation/modules/http/github-179.js b/test/instrumentation/modules/http/github-179.js index 857d998752..5db3bff715 100644 --- a/test/instrumentation/modules/http/github-179.js +++ b/test/instrumentation/modules/http/github-179.js @@ -3,7 +3,8 @@ var agent = require('../../../..').start({ serviceName: 'test', captureExceptions: false, - metricsInterval: 0 + metricsInterval: 0, + centralConfig: false }) var zlib = require('zlib') diff --git a/test/instrumentation/modules/http/github-423.js b/test/instrumentation/modules/http/github-423.js index dbd92eeadd..92ebe404b1 100644 --- a/test/instrumentation/modules/http/github-423.js +++ b/test/instrumentation/modules/http/github-423.js @@ -3,7 +3,8 @@ require('../../../..').start({ serviceName: 'test', captureExceptions: false, - metricsInterval: 0 + metricsInterval: 0, + centralConfig: false }) var http = require('http') diff --git a/test/instrumentation/modules/http2.js b/test/instrumentation/modules/http2.js index 794a95b9e6..3a43f3b1ed 100644 --- a/test/instrumentation/modules/http2.js +++ b/test/instrumentation/modules/http2.js @@ -3,7 +3,8 @@ var agent = require('../../..').start({ serviceName: 'test', captureExceptions: false, - metricsInterval: 0 + metricsInterval: 0, + centralConfig: false }) var ins = agent._instrumentation diff --git a/test/instrumentation/modules/ioredis.js b/test/instrumentation/modules/ioredis.js index b85147db68..0f0b6bcc67 100644 --- a/test/instrumentation/modules/ioredis.js +++ b/test/instrumentation/modules/ioredis.js @@ -4,7 +4,8 @@ var agent = require('../../..').start({ serviceName: 'test', secretToken: 'test', captureExceptions: false, - metricsInterval: 0 + metricsInterval: 0, + centralConfig: false }) var Redis = require('ioredis') diff --git a/test/instrumentation/modules/jade.js b/test/instrumentation/modules/jade.js index 323e63a8b4..64cdb9b066 100644 --- a/test/instrumentation/modules/jade.js +++ b/test/instrumentation/modules/jade.js @@ -6,7 +6,8 @@ var agent = require('../../..').start({ serviceName: 'test', secretToken: 'test', captureExceptions: false, - metricsInterval: 0 + metricsInterval: 0, + centralConfig: false }) var jade = require('jade') diff --git a/test/instrumentation/modules/koa-router/index.js b/test/instrumentation/modules/koa-router/index.js index a19638d989..8429a72d4a 100644 --- a/test/instrumentation/modules/koa-router/index.js +++ b/test/instrumentation/modules/koa-router/index.js @@ -4,7 +4,8 @@ var agent = require('../../../..').start({ serviceName: 'test', secretToken: 'test', captureExceptions: false, - metricsInterval: 0 + metricsInterval: 0, + centralConfig: false }) var routerVersion = require('koa-router/package').version diff --git a/test/instrumentation/modules/koa/set-framework.js b/test/instrumentation/modules/koa/set-framework.js index 605a259d3f..8a038228b3 100644 --- a/test/instrumentation/modules/koa/set-framework.js +++ b/test/instrumentation/modules/koa/set-framework.js @@ -2,7 +2,8 @@ const agent = require('../../../..').start({ captureExceptions: true, - metricsInterval: 0 + metricsInterval: 0, + centralConfig: false }) let asserts = 0 diff --git a/test/instrumentation/modules/mimic-response.js b/test/instrumentation/modules/mimic-response.js index fa9195eba1..a9daaaaf12 100644 --- a/test/instrumentation/modules/mimic-response.js +++ b/test/instrumentation/modules/mimic-response.js @@ -3,7 +3,8 @@ var agent = require('../../..').start({ serviceName: 'test', captureExceptions: false, - metricsInterval: 0 + metricsInterval: 0, + centralConfig: false }) var stream = require('stream') diff --git a/test/instrumentation/modules/mongodb-core.js b/test/instrumentation/modules/mongodb-core.js index caa57b9cc9..0cb3514011 100644 --- a/test/instrumentation/modules/mongodb-core.js +++ b/test/instrumentation/modules/mongodb-core.js @@ -4,7 +4,8 @@ var agent = require('../../..').start({ serviceName: 'test', secretToken: 'test', captureExceptions: false, - metricsInterval: 0 + metricsInterval: 0, + centralConfig: false }) var Server = require('mongodb-core').Server diff --git a/test/instrumentation/modules/mysql/mysql.js b/test/instrumentation/modules/mysql/mysql.js index d3d46fe6c2..e9c155ca11 100644 --- a/test/instrumentation/modules/mysql/mysql.js +++ b/test/instrumentation/modules/mysql/mysql.js @@ -4,7 +4,8 @@ var agent = require('../../../..').start({ serviceName: 'test', secretToken: 'test', captureExceptions: false, - metricsInterval: 0 + metricsInterval: 0, + centralConfig: false }) var mysql = require('mysql') diff --git a/test/instrumentation/modules/mysql/pool-release-1.js b/test/instrumentation/modules/mysql/pool-release-1.js index 926dff9207..5dfd89fe2f 100644 --- a/test/instrumentation/modules/mysql/pool-release-1.js +++ b/test/instrumentation/modules/mysql/pool-release-1.js @@ -4,7 +4,8 @@ var agent = require('../../../..').start({ serviceName: 'test', secretToken: 'test', captureExceptions: false, - metricsInterval: 0 + metricsInterval: 0, + centralConfig: false }) var mysql = require('mysql') diff --git a/test/instrumentation/modules/mysql2/mysql.js b/test/instrumentation/modules/mysql2/mysql.js index c93d37b36f..706566389f 100644 --- a/test/instrumentation/modules/mysql2/mysql.js +++ b/test/instrumentation/modules/mysql2/mysql.js @@ -4,7 +4,8 @@ var agent = require('../../../..').start({ serviceName: 'test', secretToken: 'test', captureExceptions: false, - metricsInterval: 0 + metricsInterval: 0, + centralConfig: false }) var semver = require('semver') diff --git a/test/instrumentation/modules/mysql2/pool-release-1.js b/test/instrumentation/modules/mysql2/pool-release-1.js index 6b6775a236..82442ac669 100644 --- a/test/instrumentation/modules/mysql2/pool-release-1.js +++ b/test/instrumentation/modules/mysql2/pool-release-1.js @@ -4,7 +4,8 @@ var agent = require('../../../..').start({ serviceName: 'test', secretToken: 'test', captureExceptions: false, - metricsInterval: 0 + metricsInterval: 0, + centralConfig: false }) var semver = require('semver') diff --git a/test/instrumentation/modules/pg/knex.js b/test/instrumentation/modules/pg/knex.js index 77e4c739a4..8bc9b66ba5 100644 --- a/test/instrumentation/modules/pg/knex.js +++ b/test/instrumentation/modules/pg/knex.js @@ -6,7 +6,8 @@ var agent = require('../../../..').start({ serviceName: 'test', secretToken: 'test', captureExceptions: false, - metricsInterval: 0 + metricsInterval: 0, + centralConfig: false }) var knexVersion = require('knex/package').version diff --git a/test/instrumentation/modules/pg/pg.js b/test/instrumentation/modules/pg/pg.js index db73362c8f..10227f13ec 100644 --- a/test/instrumentation/modules/pg/pg.js +++ b/test/instrumentation/modules/pg/pg.js @@ -4,7 +4,8 @@ var agent = require('../../../..').start({ serviceName: 'test', secretToken: 'test', captureExceptions: false, - metricsInterval: 0 + metricsInterval: 0, + centralConfig: false }) var semver = require('semver') diff --git a/test/instrumentation/modules/pug.js b/test/instrumentation/modules/pug.js index f3f5f6390d..613bbeff68 100644 --- a/test/instrumentation/modules/pug.js +++ b/test/instrumentation/modules/pug.js @@ -6,7 +6,8 @@ var agent = require('../../..').start({ serviceName: 'test', secretToken: 'test', captureExceptions: false, - metricsInterval: 0 + metricsInterval: 0, + centralConfig: false }) var pug = require('pug') diff --git a/test/instrumentation/modules/redis.js b/test/instrumentation/modules/redis.js index 9abfa1de7a..d93d48fbcc 100644 --- a/test/instrumentation/modules/redis.js +++ b/test/instrumentation/modules/redis.js @@ -4,7 +4,8 @@ var agent = require('../../..').start({ serviceName: 'test', secretToken: 'test', captureExceptions: false, - metricsInterval: 0 + metricsInterval: 0, + centralConfig: false }) var redis = require('redis') diff --git a/test/instrumentation/modules/restify/basic.js b/test/instrumentation/modules/restify/basic.js index 579098d293..f44d2f68dd 100644 --- a/test/instrumentation/modules/restify/basic.js +++ b/test/instrumentation/modules/restify/basic.js @@ -4,7 +4,8 @@ const agent = require('../../../..').start({ serviceName: 'test', secretToken: 'test', captureExceptions: false, - metricsInterval: 0 + metricsInterval: 0, + centralConfig: false }) const pkg = require('restify/package.json') diff --git a/test/instrumentation/modules/restify/set-framework.js b/test/instrumentation/modules/restify/set-framework.js index 1b4239a525..e199968268 100644 --- a/test/instrumentation/modules/restify/set-framework.js +++ b/test/instrumentation/modules/restify/set-framework.js @@ -2,7 +2,8 @@ const agent = require('../../../..').start({ captureExceptions: true, - metricsInterval: 0 + metricsInterval: 0, + centralConfig: false }) const pkg = require('restify/package.json') diff --git a/test/instrumentation/modules/tedious.js b/test/instrumentation/modules/tedious.js index ab4df2483b..895734205f 100644 --- a/test/instrumentation/modules/tedious.js +++ b/test/instrumentation/modules/tedious.js @@ -7,7 +7,8 @@ const agent = require('../../../').start({ serviceName: 'test', secretToken: 'test', captureExceptions: false, - metricsInterval: 0 + metricsInterval: 0, + centralConfig: false }) const semver = require('semver') diff --git a/test/instrumentation/modules/ws.js b/test/instrumentation/modules/ws.js index 7b43069d20..dd172a80dd 100644 --- a/test/instrumentation/modules/ws.js +++ b/test/instrumentation/modules/ws.js @@ -4,7 +4,8 @@ var agent = require('../../..').start({ serviceName: 'test', secretToken: 'test', captureExceptions: false, - metricsInterval: 0 + metricsInterval: 0, + centralConfig: false }) var version = require('restify/package.json').version diff --git a/test/integration/503.js b/test/integration/503.js index 64945ffac5..d0b26ab41f 100644 --- a/test/integration/503.js +++ b/test/integration/503.js @@ -7,6 +7,8 @@ getPort().then(function (port) { serviceName: 'test', serverUrl: 'http://localhost:' + port, captureExceptions: false, + metricsInterval: 0, + centralConfig: false, disableInstrumentations: ['http'] // avoid the agent instrumenting the mock APM Server }) diff --git a/test/integration/abort-on-invalid-cert.js b/test/integration/abort-on-invalid-cert.js index 7dcf4d12fe..95d4824a28 100644 --- a/test/integration/abort-on-invalid-cert.js +++ b/test/integration/abort-on-invalid-cert.js @@ -5,7 +5,9 @@ var getPort = require('get-port') getPort().then(function (port) { var agent = require('../../').start({ serviceName: 'test', - serverUrl: 'https://localhost:' + port + serverUrl: 'https://localhost:' + port, + metricsInterval: 0, + centralConfig: false }) var https = require('https') diff --git a/test/integration/allow-invalid-cert.js b/test/integration/allow-invalid-cert.js index 6ec6ca96b3..cc89cd9173 100644 --- a/test/integration/allow-invalid-cert.js +++ b/test/integration/allow-invalid-cert.js @@ -6,9 +6,11 @@ getPort().then(function (port) { var agent = require('../../').start({ serviceName: 'test', serverUrl: 'https://localhost:' + port, + captureExceptions: false, + metricsInterval: 0, + centralConfig: false, disableInstrumentations: ['https'], // avoid the agent instrumenting the mock APM Server - verifyServerCert: false, - metricsInterval: 0 + verifyServerCert: false }) var https = require('https') diff --git a/test/integration/api-schema/basic.js b/test/integration/api-schema/basic.js index 67ea480a36..aa46f55058 100644 --- a/test/integration/api-schema/basic.js +++ b/test/integration/api-schema/basic.js @@ -16,8 +16,6 @@ const utils = require('./_utils') const Agent = require('../../_agent') const findObjInArray = require('../../_utils').findObjInArray -process.env.ELASTIC_APM_METRICS_INTERVAL = '0' - const next = afterAll(function (err, validators) { if (err) throw err @@ -214,6 +212,8 @@ function newAgent (server) { serviceName: 'test', serverUrl: 'http://localhost:' + server.address().port, captureExceptions: false, - disableInstrumentations: ['http'] + disableInstrumentations: ['http'], + metricsInterval: 0, + centralConfig: false }) } diff --git a/test/integration/api-schema/capture-error-log-stack-traces.js b/test/integration/api-schema/capture-error-log-stack-traces.js index fd319273d5..c611b432be 100644 --- a/test/integration/api-schema/capture-error-log-stack-traces.js +++ b/test/integration/api-schema/capture-error-log-stack-traces.js @@ -72,6 +72,7 @@ function newAgent (server) { captureExceptions: false, disableInstrumentations: ['http'], captureErrorLogStackTraces: true, - metricsInterval: 0 + metricsInterval: 0, + centralConfig: false }) } diff --git a/test/integration/api-schema/capture-span-stack-traces.js b/test/integration/api-schema/capture-span-stack-traces.js index 7d279a0256..f6a5ca371a 100644 --- a/test/integration/api-schema/capture-span-stack-traces.js +++ b/test/integration/api-schema/capture-span-stack-traces.js @@ -72,6 +72,7 @@ function newAgent (server) { captureExceptions: false, disableInstrumentations: ['http'], captureSpanStackTraces: false, - metricsInterval: 0 + metricsInterval: 0, + centralConfig: false }) } diff --git a/test/integration/api-schema/source-lines-error-frames.js b/test/integration/api-schema/source-lines-error-frames.js index 267b64e301..7cf05945fe 100644 --- a/test/integration/api-schema/source-lines-error-frames.js +++ b/test/integration/api-schema/source-lines-error-frames.js @@ -73,6 +73,7 @@ function newAgent (server) { disableInstrumentations: ['http'], sourceLinesErrorAppFrames: 0, sourceLinesErrorLibraryFrames: 0, - metricsInterval: 0 + metricsInterval: 0, + centralConfig: false }) } diff --git a/test/integration/api-schema/source-lines-span-frames.js b/test/integration/api-schema/source-lines-span-frames.js index 8ef816f87b..1c52c43120 100644 --- a/test/integration/api-schema/source-lines-span-frames.js +++ b/test/integration/api-schema/source-lines-span-frames.js @@ -73,6 +73,7 @@ function newAgent (server) { disableInstrumentations: ['http'], sourceLinesSpanAppFrames: 5, sourceLinesSpanLibraryFrames: 5, - metricsInterval: 0 + metricsInterval: 0, + centralConfig: false }) } diff --git a/test/integration/no-sampling.js b/test/integration/no-sampling.js index fd926a2885..9e5758fca0 100644 --- a/test/integration/no-sampling.js +++ b/test/integration/no-sampling.js @@ -8,6 +8,8 @@ getPort().then(function (port) { serviceName: 'test', serverUrl: 'http://localhost:' + port, captureExceptions: false, + metricsInterval: 0, + centralConfig: false, disableInstrumentations: ['http'], // avoid the agent instrumenting the mock APM Server apiRequestTime: '1s' }) diff --git a/test/integration/server-url-path.js b/test/integration/server-url-path.js index d51a499bcd..c0bc54b294 100644 --- a/test/integration/server-url-path.js +++ b/test/integration/server-url-path.js @@ -7,6 +7,8 @@ getPort().then(function (port) { serviceName: 'test', serverUrl: 'http://localhost:' + port + '/sub', captureExceptions: false, + metricsInterval: 0, + centralConfig: false, disableInstrumentations: ['http'] // avoid the agent instrumenting the mock APM Server }) diff --git a/test/integration/skip-internal-http-spans.js b/test/integration/skip-internal-http-spans.js index 28e835ad8f..5207bc78df 100644 --- a/test/integration/skip-internal-http-spans.js +++ b/test/integration/skip-internal-http-spans.js @@ -9,7 +9,8 @@ getPort().then(port => { serviceName: 'test', serverUrl: 'http://localhost:' + port, captureExceptions: false, - metricsInterval: 0 + metricsInterval: 0, + centralConfig: false }) // hack to ensure that all incoming http requests picked up on the mock APM diff --git a/test/integration/socket-close.js b/test/integration/socket-close.js index bde38cf14b..2349c825a8 100644 --- a/test/integration/socket-close.js +++ b/test/integration/socket-close.js @@ -7,6 +7,8 @@ getPort().then(function (port) { serviceName: 'test', serverUrl: 'http://localhost:' + port, captureExceptions: false, + metricsInterval: 0, + centralConfig: false, disableInstrumentations: ['http'] // avoid the agent instrumenting the mock APM Server }) diff --git a/test/types/commonjs.js b/test/types/commonjs.js index eee3130492..34e4829b3b 100644 --- a/test/types/commonjs.js +++ b/test/types/commonjs.js @@ -4,5 +4,6 @@ const agent = require('../../') agent.start({ captureExceptions: false, - metricsInterval: '0' + metricsInterval: '0', + centralConfig: false }) diff --git a/test/types/index.ts b/test/types/index.ts index 4196a2ecfe..30c171f57a 100644 --- a/test/types/index.ts +++ b/test/types/index.ts @@ -2,7 +2,8 @@ import agent from '../../' agent.start({ captureExceptions: false, - metricsInterval: '0' + metricsInterval: '0', + centralConfig: false }) function started (bool: boolean) {} diff --git a/test/types/transpile/index.ts b/test/types/transpile/index.ts index 8ef3a7b62f..ad8df29fc3 100644 --- a/test/types/transpile/index.ts +++ b/test/types/transpile/index.ts @@ -2,5 +2,6 @@ import agent from '../../../' agent.start({ captureExceptions: false, - metricsInterval: '0' + metricsInterval: '0', + centralConfig: false })