Skip to content

Commit

Permalink
refactor(config): rename to instrumentIncomingHTTPRequests
Browse files Browse the repository at this point in the history
The 'monitor' prefix was replaced by 'instrument' to better
align with other config names.
  • Loading branch information
Qard committed Aug 27, 2019
1 parent aa46b28 commit 8ce0462
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 6 deletions.
6 changes: 3 additions & 3 deletions lib/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ var DEFAULTS = {
logLevel: 'info',
metricsInterval: '30s',
metricsLimit: 1000,
monitorIncomingHTTPRequests: true,
instrumentIncomingHTTPRequests: true,
centralConfig: true,
serverTimeout: '30s',
sourceLinesErrorAppFrames: 5,
Expand Down Expand Up @@ -99,14 +99,14 @@ 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'],
kubernetesPodUID: ['ELASTIC_APM_KUBERNETES_POD_UID', 'KUBERNETES_POD_UID'],
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',
Expand Down Expand Up @@ -144,7 +144,7 @@ var BOOL_OPTS = [
'errorOnAbortedRequests',
'filterHttpHeaders',
'instrument',
'monitorIncomingHTTPRequests',
'instrumentIncomingHTTPRequests',
'usePathAsTransactionName',
'verifyServerCert'
]
Expand Down
2 changes: 1 addition & 1 deletion lib/instrumentation/modules/http.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'))

Expand Down
2 changes: 1 addition & 1 deletion lib/instrumentation/modules/http2.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion lib/instrumentation/modules/https.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'))
}
Expand Down
1 change: 1 addition & 0 deletions test/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'],
Expand Down

0 comments on commit 8ce0462

Please sign in to comment.