Skip to content

Commit 801b54b

Browse files
authored
Modified context missing strategy default to log error (#550)
1 parent dd02e9e commit 801b54b

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

packages/core/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ section for different usages.
5757
AWS_XRAY_TRACING_NAME For overriding the default segment name to use
5858
with the middleware. See 'dynamic and fixed naming modes'.
5959
AWS_XRAY_DAEMON_ADDRESS For setting the daemon address and port.
60-
AWS_XRAY_CONTEXT_MISSING For setting the SDK behavior when trace context is missing. Valid values are 'RUNTIME_ERROR', 'IGNORE_ERROR' or 'LOG_ERROR'. The SDK's default behavior is 'RUNTIME_ERROR'.
60+
AWS_XRAY_CONTEXT_MISSING For setting the SDK behavior when trace context is missing. Valid values are 'RUNTIME_ERROR', 'IGNORE_ERROR' or 'LOG_ERROR'. The SDK's default behavior is 'LOG_ERROR'.
6161
AWS_XRAY_LOG_LEVEL Sets a log level for the SDK built in logger. This value is ignored if AWS_XRAY_DEBUG_MODE is set.
6262
AWS_XRAY_COLLECT_SQL_QUERIES Enables SQL query capture (currently only Postgres supported)
6363

packages/core/lib/context_utils.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -212,8 +212,8 @@ if (process.env.AWS_XRAY_CONTEXT_MISSING) {
212212
contextUtils.setContextMissingStrategy(process.env.AWS_XRAY_CONTEXT_MISSING);
213213
contextOverride = true;
214214
} else {
215-
contextUtils.contextMissingStrategy.contextMissing = contextUtils.CONTEXT_MISSING_STRATEGY.RUNTIME_ERROR.contextMissing;
216-
logger.getLogger().debug('Using default context missing strategy: RUNTIME_ERROR');
215+
contextUtils.contextMissingStrategy.contextMissing = contextUtils.CONTEXT_MISSING_STRATEGY.LOG_ERROR.contextMissing;
216+
logger.getLogger().debug('Using default context missing strategy: LOG_ERROR');
217217
}
218218

219219
module.exports = contextUtils;

packages/core/test/unit/context_utils.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ describe('ContextUtils', function() {
3737
assert.equal(ContextUtils.getNamespace().name, 'AWSXRay');
3838
});
3939

40-
it('should set the contextMissingStrategy to RUNTIME_ERROR by default', function() {
41-
assert.equal(ContextUtils.contextMissingStrategy.contextMissing.name, RUNTIME_ERROR_FCN_NAME);
40+
it('should set the contextMissingStrategy to LOG_ERROR by default', function() {
41+
assert.equal(ContextUtils.contextMissingStrategy.contextMissing.name, LOG_ERROR_FCN_NAME);
4242
});
4343

4444
it('should set the contextMissingStrategy to the process.env.AWS_XRAY_CONTEXT_MISSING strategy if present', function() {

0 commit comments

Comments
 (0)