Skip to content

Releases: terodox/aws-xray-lambda-promise-subsegment

Update dependencies

22 Mar 00:05
Compare
Choose a tag to compare

This PR is to update dependencies to their latest versions

Fix some small issues

22 Mar 00:00
Compare
Choose a tag to compare

The build was failing and therefore the last version failed.

This is a fix for that failure.

AWS SDK v3 and Drop Node 10 support

22 Oct 12:34
Compare
Choose a tag to compare

This change come with 2 breaking changes:

  • Dropped support for Node version 10
  • Updated to version 3 of aws-xray-sdk-core

Added:

  • Now exporting type definitions for aws-xray-sdk-core items that are applicable to this package.

fix type definition

05 Feb 11:50
Compare
Choose a tag to compare

fix type definition causing 'error TS2314: Generic type 'Promise requires 1 type argument(s).

Thanks again to @peteroreil for the contribution!

Add a simple function for basic use cases

03 Oct 00:16
Compare
Choose a tag to compare

This minor version introduces a new function to handle very basic use cases.

addSegment has a very basic contract:

function addSegment<T>(segmentName: string, promise: Promise): Promise<T>;

It's the simplest form possible for adding a new segment to a trace.

Allow nested traces

16 Apr 14:17
Compare
Choose a tag to compare

🚨BREAKING CHANGES🚨

This release brings the ability to run nested traces along with a reworking of the method contract.

A key change here is the move from promiseFactory being a promise - to promiseFactory now being a function! Check out the signature below for more information.

// Old contract
export declare function addPromiseSegment<T>(subSegmentName: string, promiseToWrap: Promise<T>, additionalMetaData?: Metadata, annotations?: Annotations): Promise<T>;

// New Contract
export declare function addPromiseSegment<T>({
    annotations,
    metaData,
    parentSegment,
    promiseFactory,
    segmentName
}: {
    annotations?: Annotations,
    metaData?: Metadata,
    parentSegment?: object,
    promiseFactory: (subsegment) => Promise<T>,
    segmentName: string
}): Promise<T>;

This give more flexibility with adding annotations without metadata and vice-versa. The additional benefit is the passing out of the subsegment in the promiseFactory. This will allow you to pass that new subsegment as the parentSegment for another promise subsegment creating a hierarchy of calls in X-Ray.

NOTE: The most important change here is moving from passing in a promise, to passing in a promiseFactory that will return a promise.