Closed lym953 closed 2 months ago
In a State Machine, if a Lambda execution step's Payload field is not a JSON object, e.g.
Payload
"Lambda Invoke": { "Type": "Task", "Resource": "arn:aws:states:::lambda:invoke", "OutputPath": "$.Payload", "Parameters": { "FunctionName": "arn:aws:lambda:sa-east-1:425362996713:function:yimingPlayground", "Payload": "Just a string!" }, "Next": "Step Functions StartExecution" },
then print a warning and skip context injection.
This is case # 3 in this design doc: Fixing Step Function Instrumentation
To inject context into Lambda payload, the payload must be a JSON dictionary. Injection can't work if payload is a string.
Passed the added test and existing tests
yarn prepack
./dist/cli.js stepfunctions instrument
A warning is printed:
Branch report: yiming.luo/fix-step-func-10 Commit report: 65bed16 Test service: datadog-ci-tests
yiming.luo/fix-step-func-10
65bed16
datadog-ci-tests
:white_check_mark: 0 Failed, 2522 Passed, 0 Skipped, 2m 12.08s Total duration (1m 29.18s time saved)
What
In a State Machine, if a Lambda execution step's
Payload
field is not a JSON object, e.g.then print a warning and skip context injection.
This is case # 3 in this design doc: Fixing Step Function Instrumentation
Why
To inject context into Lambda payload, the payload must be a JSON dictionary. Injection can't work if payload is a string.
Testing
Automated testing
Passed the added test and existing tests
Manual testing
Steps
Payload
field as shown in the "What" sectionyarn prepack
./dist/cli.js stepfunctions instrument
Result
A warning is printed:
Review checklist