Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add export for resolveManualSegmentParams to AWSXRay #628

Merged
merged 8 commits into from
Jan 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading