Module: context_utils

Methods

(static) enableAutomaticMode()

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

(static) enableManualMode()

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

(static) getNamespace() → {Namespace}

Gets current CLS namespace for X-Ray SDK or creates one if absent.
Source:
Returns:
Type
Namespace

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

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

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

Returns true if in automatic mode, otherwise false.
Source:
Returns:
Type
Segment | Subsegment

(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:
Returns:
Type
Segment | Subsegment

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

Resolves the segment or subsegment given manual or automatic mode.
Parameters:
Name Type Attributes Description
Segment|Subsegment <optional>
segment - The segment manually provided, if provided.
Source:
Returns:
Type
Segment | Subsegment

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

Sets the current segment or subsegment. For use with in automatic mode only.
Parameters:
Name Type Attributes Description
Segment|Subsegment <optional>
segment - The sub/segment to set.
Source:
Returns:
Type
Segment | Subsegment