Skip to content

Commit 8ce0462

Browse files
committed
refactor(config): rename to instrumentIncomingHTTPRequests
The 'monitor' prefix was replaced by 'instrument' to better align with other config names.
1 parent aa46b28 commit 8ce0462

File tree

5 files changed

+7
-6
lines changed

5 files changed

+7
-6
lines changed

lib/config.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ var DEFAULTS = {
6161
logLevel: 'info',
6262
metricsInterval: '30s',
6363
metricsLimit: 1000,
64-
monitorIncomingHTTPRequests: true,
64+
instrumentIncomingHTTPRequests: true,
6565
centralConfig: true,
6666
serverTimeout: '30s',
6767
sourceLinesErrorAppFrames: 5,
@@ -99,14 +99,14 @@ var ENV_TABLE = {
9999
globalLabels: 'ELASTIC_APM_GLOBAL_LABELS',
100100
hostname: 'ELASTIC_APM_HOSTNAME',
101101
instrument: 'ELASTIC_APM_INSTRUMENT',
102+
instrumentIncomingHTTPRequests: 'ELASTIC_APM_INSTRUMENT_INCOMING_HTTP_REQUESTS',
102103
kubernetesNamespace: ['ELASTIC_APM_KUBERNETES_NAMESPACE', 'KUBERNETES_NAMESPACE'],
103104
kubernetesNodeName: ['ELASTIC_APM_KUBERNETES_NODE_NAME', 'KUBERNETES_NODE_NAME'],
104105
kubernetesPodName: ['ELASTIC_APM_KUBERNETES_POD_NAME', 'KUBERNETES_POD_NAME'],
105106
kubernetesPodUID: ['ELASTIC_APM_KUBERNETES_POD_UID', 'KUBERNETES_POD_UID'],
106107
logLevel: 'ELASTIC_APM_LOG_LEVEL',
107108
metricsInterval: 'ELASTIC_APM_METRICS_INTERVAL',
108109
metricsLimit: 'ELASTIC_APM_METRICS_LIMIT',
109-
monitorIncomingHTTPRequests: 'ELASTIC_APM_MONITOR_INCOMING_HTTP_REQUESTS',
110110
payloadLogFile: 'ELASTIC_APM_PAYLOAD_LOG_FILE',
111111
centralConfig: 'ELASTIC_APM_CENTRAL_CONFIG',
112112
secretToken: 'ELASTIC_APM_SECRET_TOKEN',
@@ -144,7 +144,7 @@ var BOOL_OPTS = [
144144
'errorOnAbortedRequests',
145145
'filterHttpHeaders',
146146
'instrument',
147-
'monitorIncomingHTTPRequests',
147+
'instrumentIncomingHTTPRequests',
148148
'usePathAsTransactionName',
149149
'verifyServerCert'
150150
]

lib/instrumentation/modules/http.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ var httpShared = require('../http-shared')
66
var shimmer = require('../shimmer')
77

88
module.exports = function (http, agent, { enabled }) {
9-
if (agent._conf.monitorIncomingHTTPRequests) {
9+
if (agent._conf.instrumentIncomingHTTPRequests) {
1010
agent.logger.debug('shimming http.Server.prototype.emit function')
1111
shimmer.wrap(http && http.Server && http.Server.prototype, 'emit', httpShared.instrumentRequest(agent, 'http'))
1212

lib/instrumentation/modules/http2.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ var shimmer = require('../shimmer')
88
var symbols = require('../../symbols')
99

1010
module.exports = function (http2, agent, { enabled }) {
11-
if (agent._conf.monitorIncomingHTTPRequests) {
11+
if (agent._conf.instrumentIncomingHTTPRequests) {
1212
agent.logger.debug('shimming http2.createServer function')
1313
shimmer.wrap(http2, 'createServer', wrapCreateServer)
1414
shimmer.wrap(http2, 'createSecureServer', wrapCreateServer)

lib/instrumentation/modules/https.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ var httpShared = require('../http-shared')
66
var shimmer = require('../shimmer')
77

88
module.exports = function (https, agent, { version, enabled }) {
9-
if (agent._conf.monitorIncomingHTTPRequests) {
9+
if (agent._conf.instrumentIncomingHTTPRequests) {
1010
agent.logger.debug('shimming https.Server.prototype.emit function')
1111
shimmer.wrap(https && https.Server && https.Server.prototype, 'emit', httpShared.instrumentRequest(agent, 'https'))
1212
}

test/config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ var optionFixtures = [
4646
['frameworkVersion', 'FRAMEWORK_VERSION'],
4747
['hostname', 'HOSTNAME'],
4848
['instrument', 'INSTRUMENT', true],
49+
['instrumentIncomingHTTPRequests', 'INSTRUMENT_INCOMING_HTTP_REQUESTS', true],
4950
['kubernetesNamespace', 'KUBERNETES_NAMESPACE'],
5051
['kubernetesNodeName', 'KUBERNETES_NODE_NAME'],
5152
['kubernetesPodName', 'KUBERNETES_POD_NAME'],

0 commit comments

Comments
 (0)