Skip to content

Commit

Permalink
Add export for resolveManualSegmentParams to AWSXRay (#628)
Browse files Browse the repository at this point in the history
* Add export for resolveManualSegmentParams to AWSXRay
* Update comment

---------

Co-authored-by: Jason Terando <[email protected]>
Co-authored-by: Jonathan Lee <[email protected]>
  • Loading branch information
3 people authored Jan 29, 2024
1 parent b6fb649 commit 1d50325
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/core/lib/aws-xray.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ export { middleware };
export {
getNamespace,
resolveSegment,
resolveManualSegmentParams,
getSegment,
setSegment,
isAutomaticMode,
Expand Down
11 changes: 11 additions & 0 deletions packages/core/lib/aws-xray.js
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,17 @@ var AWSXRay = {

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
Expand Down
2 changes: 2 additions & 0 deletions packages/core/lib/context_utils.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ export function getNamespace(): Namespace;

export function resolveSegment(segment?: Segment | Subsegment | null): Segment | Subsegment | undefined;

export function resolveManualSegmentParams(segment?: Segment | Subsegment | null): Segment | Subsegment | undefined;

export function getSegment(): Segment | Subsegment | undefined;

export function setSegment(segment: Segment | Subsegment): void;
Expand Down

0 comments on commit 1d50325

Please sign in to comment.