in packages/core/lib/aws-xray.js [255:374]
middleware: require('./middleware/mw_utils'),
/**
* Gets the current namespace of the context.
* Used for supporting functions that can be used in automatic mode.
* @memberof AWSXRay
* @function
* @returns {Segment|Subsegment}
* @see module:context_utils.getNamespace
*/
getNamespace: contextUtils.getNamespace,
/**
* Resolves the current segment or subsegment, checks manual and automatic modes.
* Used for supporting functions that can be used in both manual and automatic modes.
* @memberof AWSXRay
* @function
* @returns {Segment|Subsegment}
* @see module:context_utils.resolveSegment
*/
resolveSegment: contextUtils.resolveSegment,
/**
* Resolves the segment or subsegment given manual mode and params on the call required.
* @param [Segment|Subsegment] segment - The segment manually provided via params.XraySegment, if provided.
* @memberof AWSXRay
* @function
* @returns {Segment|Subsegment}
* @see module:context_utils.resolveManualSegmentParams
*/
resolveManualSegmentParams: contextUtils.resolveManualSegmentParams,
/**
* Returns the current segment or subsegment. For use with automatic mode only.
* @memberof AWSXRay
* @function
* @returns {Segment|Subsegment}
* @see module:context_utils.getSegment
*/
getSegment: contextUtils.getSegment,
/**
* Sets the current segment or subsegment. For use with automatic mode only.
* @memberof AWSXRay
* @function
* @see module:context_utils.setSegment
*/
setSegment: contextUtils.setSegment,
/**
* Returns true if automatic mode is enabled, otherwise false.
* @memberof AWSXRay
* @function
* @see module:context_utils.isAutomaticMode
*/
isAutomaticMode: contextUtils.isAutomaticMode,
/**
* Enables automatic mode. Automatic mode uses 'cls-hooked'.
* @see https://github.com/jeff-lewis/cls-hooked
* @memberof AWSXRay
* @function
* @see module:context_utils.enableAutomaticMode
*/
enableAutomaticMode: contextUtils.enableAutomaticMode,
/**
* Disables automatic mode. Current segment or subsegment must be passed manually
* via the parent optional on captureFunc, captureAsyncFunc etc.
* @memberof AWSXRay
* @function
* @see module:context_utils.enableManualMode
*/
enableManualMode: contextUtils.enableManualMode,
/**
* Sets the context missing strategy.
* @param {Object} strategy - The strategy to set. This object's contextMissing function will be called whenever trace context is not found.
*/
setContextMissingStrategy: contextUtils.setContextMissingStrategy,
/**
* Exposes the segment class.
* @memberof AWSXRay
* @function
*/
Segment: require('./segments/segment'),
/**
* Exposes the subsegment class.
* @memberof AWSXRay
* @see Subsegment
*/
Subsegment: require('./segments/attributes/subsegment'),
SegmentUtils: segmentUtils
};
/**
* Exposes the IncomingRequestData, to capture incoming request data.
* For use with middleware.
* @memberof AWSXRay.middleware
* @see IncomingRequestData
*/
AWSXRay.middleware.IncomingRequestData = require('./middleware/incoming_request_data'),
(function() {