diff --git a/src/commands/stepfunctions/helpers.ts b/src/commands/stepfunctions/helpers.ts index a4517e4e3..38971018f 100644 --- a/src/commands/stepfunctions/helpers.ts +++ b/src/commands/stepfunctions/helpers.ts @@ -150,9 +150,16 @@ check out https://docs.datadoghq.com/serverless/step_functions/troubleshooting/\ return true } + // context injection is already set up + if (step.Parameters['Payload.$'] === 'States.JsonMerge($$, $, false)') { + context.stdout.write(` Step ${stepName}: Context injection is already set up. Skipping context injection.\n`) + + return false + } + // custom payload context.stdout - .write(`[Warn] Step ${stepName} has a custom Payload field. Step Functions Context Object injection skipped. \ + .write(`[Warn] Step ${stepName}: has a custom Payload field. Step Functions Context Object injection skipped. \ Your Step Functions trace will not be merged with downstream Lambda traces. To manually merge these traces, \ check out https://docs.datadoghq.com/serverless/step_functions/troubleshooting/\n`) @@ -203,6 +210,13 @@ merge these traces, check out https://docs.datadoghq.com/serverless/step_functio return true } + // context injection is already set up + if (step.Parameters.Input['CONTEXT.$'] === 'States.JsonMerge($$, $, false)') { + context.stdout.write(` Step ${stepName}: Context injection is already set up. Skipping context injection.\n`) + + return false + } + context.stdout .write(`[Warn] Step ${stepName}'s Parameters.Input field has a custom CONTEXT field. Step Functions Context \ Object injection skipped. Your Step Functions trace will not be merged with downstream Step Function traces. To \