diff --git a/lib/config.js b/lib/config.js index 18ef922e149..3f10a393419 100644 --- a/lib/config.js +++ b/lib/config.js @@ -61,7 +61,7 @@ var DEFAULTS = { logLevel: 'info', metricsInterval: '30s', metricsLimit: 1000, - monitorIncomingHTTPRequests: true, + instrumentIncomingHTTPRequests: true, centralConfig: true, serverTimeout: '30s', sourceLinesErrorAppFrames: 5, @@ -99,6 +99,7 @@ var ENV_TABLE = { globalLabels: 'ELASTIC_APM_GLOBAL_LABELS', hostname: 'ELASTIC_APM_HOSTNAME', instrument: 'ELASTIC_APM_INSTRUMENT', + instrumentIncomingHTTPRequests: 'ELASTIC_APM_INSTRUMENT_INCOMING_HTTP_REQUESTS', kubernetesNamespace: ['ELASTIC_APM_KUBERNETES_NAMESPACE', 'KUBERNETES_NAMESPACE'], kubernetesNodeName: ['ELASTIC_APM_KUBERNETES_NODE_NAME', 'KUBERNETES_NODE_NAME'], kubernetesPodName: ['ELASTIC_APM_KUBERNETES_POD_NAME', 'KUBERNETES_POD_NAME'], @@ -106,7 +107,6 @@ var ENV_TABLE = { logLevel: 'ELASTIC_APM_LOG_LEVEL', metricsInterval: 'ELASTIC_APM_METRICS_INTERVAL', metricsLimit: 'ELASTIC_APM_METRICS_LIMIT', - monitorIncomingHTTPRequests: 'ELASTIC_APM_MONITOR_INCOMING_HTTP_REQUESTS', payloadLogFile: 'ELASTIC_APM_PAYLOAD_LOG_FILE', centralConfig: 'ELASTIC_APM_CENTRAL_CONFIG', secretToken: 'ELASTIC_APM_SECRET_TOKEN', @@ -144,7 +144,7 @@ var BOOL_OPTS = [ 'errorOnAbortedRequests', 'filterHttpHeaders', 'instrument', - 'monitorIncomingHTTPRequests', + 'instrumentIncomingHTTPRequests', 'usePathAsTransactionName', 'verifyServerCert' ] diff --git a/lib/instrumentation/modules/http.js b/lib/instrumentation/modules/http.js index f5f9877d871..344a53f04fe 100644 --- a/lib/instrumentation/modules/http.js +++ b/lib/instrumentation/modules/http.js @@ -6,7 +6,7 @@ var httpShared = require('../http-shared') var shimmer = require('../shimmer') module.exports = function (http, agent, { enabled }) { - if (agent._conf.monitorIncomingHTTPRequests) { + if (agent._conf.instrumentIncomingHTTPRequests) { agent.logger.debug('shimming http.Server.prototype.emit function') shimmer.wrap(http && http.Server && http.Server.prototype, 'emit', httpShared.instrumentRequest(agent, 'http')) diff --git a/lib/instrumentation/modules/http2.js b/lib/instrumentation/modules/http2.js index db2ab458ce7..e12f83ee3a6 100644 --- a/lib/instrumentation/modules/http2.js +++ b/lib/instrumentation/modules/http2.js @@ -8,7 +8,7 @@ var shimmer = require('../shimmer') var symbols = require('../../symbols') module.exports = function (http2, agent, { enabled }) { - if (agent._conf.monitorIncomingHTTPRequests) { + if (agent._conf.instrumentIncomingHTTPRequests) { agent.logger.debug('shimming http2.createServer function') shimmer.wrap(http2, 'createServer', wrapCreateServer) shimmer.wrap(http2, 'createSecureServer', wrapCreateServer) diff --git a/lib/instrumentation/modules/https.js b/lib/instrumentation/modules/https.js index 4850455edcd..80aa90a4fe9 100644 --- a/lib/instrumentation/modules/https.js +++ b/lib/instrumentation/modules/https.js @@ -6,7 +6,7 @@ var httpShared = require('../http-shared') var shimmer = require('../shimmer') module.exports = function (https, agent, { version, enabled }) { - if (agent._conf.monitorIncomingHTTPRequests) { + if (agent._conf.instrumentIncomingHTTPRequests) { agent.logger.debug('shimming https.Server.prototype.emit function') shimmer.wrap(https && https.Server && https.Server.prototype, 'emit', httpShared.instrumentRequest(agent, 'https')) } diff --git a/test/config.js b/test/config.js index b6604ac6480..a95bbcf26a5 100644 --- a/test/config.js +++ b/test/config.js @@ -46,6 +46,7 @@ var optionFixtures = [ ['frameworkVersion', 'FRAMEWORK_VERSION'], ['hostname', 'HOSTNAME'], ['instrument', 'INSTRUMENT', true], + ['instrumentIncomingHTTPRequests', 'INSTRUMENT_INCOMING_HTTP_REQUESTS', true], ['kubernetesNamespace', 'KUBERNETES_NAMESPACE'], ['kubernetesNodeName', 'KUBERNETES_NODE_NAME'], ['kubernetesPodName', 'KUBERNETES_POD_NAME'],