Module: http_p

Members

(inner) url

This module patches the HTTP and HTTPS node built-in libraries and returns a copy of the module with tracing enabled.
Source:

Methods

(static) captureHTTPs(module, downstreamXRayEnabled, subsegmentCallback) → {http|https}

Wraps the http/https.request() and .get() calls to automatically capture information for the segment. Returns an instance of the HTTP or HTTPS module that is patched.
Parameters:
Name Type Description
module http | https The built in Node.js HTTP or HTTPS module.
downstreamXRayEnabled boolean when true, adds a "traced:true" property to the subsegment so the AWS X-Ray service expects a corresponding segment from the downstream service.
subsegmentCallback function a callback that is called with the subsegment, the Node.js http.ClientRequest, and the Node.js http.IncomingMessage to allow custom annotations and metadata to be added to the subsegment.
Source:
Returns:
Type
http | https

(static) captureHTTPsGlobal(module, downstreamXRayEnabled, subsegmentCallback)

Wraps the http/https.request() and .get() calls to automatically capture information for the segment. This patches the built-in HTTP and HTTPS modules globally. If using a 3rd party HTTP library, it should still use HTTP under the hood. Be sure to patch globally before requiring the 3rd party library. 3rd party library compatibility is best effort. Some incompatibility issues may arise.
Parameters:
Name Type Description
module http | https The built in Node.js HTTP or HTTPS module.
downstreamXRayEnabled boolean when true, adds a "traced:true" property to the subsegment so the AWS X-Ray service expects a corresponding segment from the downstream service.
subsegmentCallback function a callback that is called with the subsegment, the Node.js http.ClientRequest, the Node.js http.IncomingMessage (if a response was received) and any error issued, allowing custom annotations and metadata to be added. to be added to the subsegment.
Source: