Namespace: AWSXRay

AWSXRay

A module representing the AWSXRay SDK.
Source:

Namespaces

database
plugins

Members

(static) appendAWSWhitelist

Appends to the current whitelisting file. In the case of a duplicate service API listed, the new source will override the previous values.
Source:

(static) getLogger

Gets the set logger for the SDK.
Source:

(static) setAWSWhitelist

Overrides the default whitelisting file to specify what params to capture on each AWS Service call. If a service or API is not listed, no additional data is captured. The base whitelisting file can be found at /lib/resources/aws_whitelist.json
Source:

(static) setContextMissingStrategy

Sets the context missing strategy.
Source:

(static) setLogger

Set your own logger for the SDK.
Source:

(static) setStreamingThreshold

Overrides the default streaming threshold (100). The threshold represents the maximum number of subsegments on a single segment before the SDK begins to send the completed subsegments out of band of the main segment. Reduce this threshold if you see the 'Segment too large to send' error.
Source:

(static) Subsegment

Exposes the subsegment class.
Source:
See:

Methods

(static) captureAsyncFunc(name, fcn, parentopt)

Parameters:
Name Type Attributes Description
name string The name of the new subsegment.
fcn function The function conext to wrap.
parent Segment | Subsegment <optional>
The parent for the new subsegment, for manual mode.
Source:
See:

(static) captureAWS(awssdk)

Parameters:
Name Type Description
awssdk AWS The Javascript AWS SDK.
Source:
See:

(static) captureAWSClient(service)

Parameters:
Name Type Description
service AWS.Service An instance of a AWS service to wrap.
Source:
See:

(static) captureAWSv3Client(service, segment)

Parameters:
Name Type Description
service AWSv3.Service An instance of a AWS SDK v3 service to wrap.
segment Segment | Subsegment Optional segment for manual mode.
Source:
See:
  • module:aws3_p.captureAWSClient

(static) captureCallbackFunc(name, fcn, parentopt)

Parameters:
Name Type Attributes Description
name string The name of the new subsegment.
fcn function The function conext to wrap.
parent Segment | Subsegment <optional>
The parent for the new subsegment, for manual mode.
Source:
See:

(static) captureFunc(name, fcn, parentopt)

Parameters:
Name Type Attributes Description
name string The name of the new subsegment.
fcn function The function conext to wrap.
parent Segment | Subsegment <optional>
The parent for the new subsegment, for manual mode.
Source:
See:

(static) captureHTTPs(module) → {http|https}

Parameters:
Name Type Description
module http | https The built in Node.js HTTP or HTTPS module.
Source:
See:
Returns:
Type
http | https

(static) captureHTTPsGlobal(module)

Parameters:
Name Type Description
module http | https The built in Node.js HTTP or HTTPS module.
Source:
See:

(static) capturePromise()

Source:
See:
  • module:promise_p.capturePromise

(static) config(plugins)

Enables use of plugins to capture additional data for segments.
Parameters:
Name Type Description
plugins Array A configurable subset of AWSXRay.plugins.
Source:
See:

(static) DaemonConfig(address)

Configures the address and port the daemon is expected to be on.
Parameters:
Name Type Description
address string Address of the daemon the segments should be sent to. Expects 'x.x.x.x', ':yyyy' or 'x.x.x.x:yyyy' IPv4 formats.
Source:
See:
  • module:DaemonConfig.setDaemonAddress

(static) enableAutomaticMode()

Enables automatic mode. Automatic mode uses 'cls-hooked'.
Source:
See:

(static) enableManualMode()

Disables automatic mode. Current segment or subsegment must be passed manually via the parent optional on captureFunc, captureAsyncFunc etc.
Source:
See:

(static) getNamespace() → {Segment|Subsegment}

Gets the current namespace of the context. Used for supporting functions that can be used in automatic mode.
Source:
See:
Returns:
Type
Segment | Subsegment

(static) getSegment() → {Segment|Subsegment}

Returns the current segment or subsegment. For use with automatic mode only.
Source:
See:
Returns:
Type
Segment | Subsegment

(static) isAutomaticMode()

Returns true if automatic mode is enabled, otherwise false.
Source:
See:

(static) middleware()

Exposes the Middleware Utils class.
Source:
See:

(static) resolveManualSegmentParams(Segment|Subsegmentopt) → {Segment|Subsegment}

Resolves the segment or subsegment given manual mode and params on the call required.
Parameters:
Name Type Attributes Description
Segment|Subsegment <optional>
segment - The segment manually provided via params.XraySegment, if provided.
Source:
See:
Returns:
Type
Segment | Subsegment

(static) resolveSegment() → {Segment|Subsegment}

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.
Source:
See:
Returns:
Type
Segment | Subsegment

(static) Segment()

Exposes the segment class.
Source:

(static) setSamplingRules(source)

Overrides the default sampling rules file to specify at what rate to sample at for specific routes. The base sampling rules file can be found at /lib/resources/default_sampling_rules.json
Parameters:
Name Type Description
source string | Object The path to the custom sampling rules file, or the source JSON object.
Source:

(static) setSegment()

Sets the current segment or subsegment. For use with automatic mode only.
Source:
See:

(static) setStreamingThreshold(threshold)

Overrides the default streaming threshold (100). The threshold represents the maximum number of subsegments on a single segment before the SDK beings to send the completed subsegments out of band of the main segment. Reduce this threshold if you see the 'Segment too large to send' error.
Parameters:
Name Type Description
threshold number The new threshold to use.
Source:

(static) traceRequestResponseCycle(req, res) → {Segment}

Traces the request/response cycle of an http.IncomingMessage / http.ServerResponse pair. Resolves sampling rules, creates a segment, adds the core request / response data adding throttling / error / fault flags based on the response status code.
Parameters:
Name Type Description
req http.IncomingMessage The incoming request.
res http.ServerResponse The server response.
Source:
Returns:
Type
Segment

(static) utils()

Exposes various helper methods.
Source:
See: