diff --git a/src/trace/context/extractors/step-function.spec.ts b/src/trace/context/extractors/step-function.spec.ts index 723bab67..609b5ffa 100644 --- a/src/trace/context/extractors/step-function.spec.ts +++ b/src/trace/context/extractors/step-function.spec.ts @@ -13,7 +13,6 @@ describe("StepFunctionEventTraceExtractor", () => { RoleArn: "arn:aws:iam::425362996713:role/service-role/StepFunctions-abhinav-activity-state-machine-role-22jpbgl6j", StartTime: "2024-12-04T19:38:04.069Z", - RedriveCount: 0, }, State: { Name: "Lambda Invoke", diff --git a/src/trace/step-function-service.spec.ts b/src/trace/step-function-service.spec.ts index faf9b081..1eb6a710 100644 --- a/src/trace/step-function-service.spec.ts +++ b/src/trace/step-function-service.spec.ts @@ -109,16 +109,6 @@ describe("StepFunctionContextService", () => { }, }, ], - [ - "Execution RedriveCount is not a number", - { - ...legacyStepFunctionEvent, - Execution: { - ...legacyStepFunctionEvent.Execution, - RedriveCount: "0", - }, - }, - ], [ "State is not defined", { diff --git a/src/trace/step-function-service.ts b/src/trace/step-function-service.ts index be987b67..29510bc9 100644 --- a/src/trace/step-function-service.ts +++ b/src/trace/step-function-service.ts @@ -215,7 +215,7 @@ export class StepFunctionContextService { if (this.isValidContextObject(event)) { return { execution_id: event.Execution.Id, - redrive_count: event.Execution.RedriveCount.toString(), + redrive_count: (event.Execution.RedriveCount ?? "0").toString(), state_entered_time: event.State.EnteredTime, state_name: event.State.Name, }; @@ -228,7 +228,6 @@ export class StepFunctionContextService { private isValidContextObject(context: any): boolean { return ( typeof context?.Execution?.Id === "string" && - typeof context?.Execution?.RedriveCount === "number" && typeof context?.State?.EnteredTime === "string" && typeof context?.State?.Name === "string" );