Closed lym953 closed 2 months ago
Branch report: yiming.luo/fix-step-func-3
Commit report: e9c812d
Test service: datadog-ci-tests
:white_check_mark: 0 Failed, 372 Passed, 0 Skipped, 1m 29.08s Total duration (1m 58.6s time saved)
Also skip context injection when a custom "Payload": ... field is used (without $) For customized payload, we can still explicitly inject
"Execution.$": "$$.Execution", "State.$": "$$.State"
Will there be another PR for such handling?
Will there be another PR for such handling?
@nine5two7 You mean the injection thing? Yes I'll do it in separate PRs. All the PRs so far are small fixes, either printing warnings or making error messages more clear.
Problem
If a Lambda function in a State Machine has a custom
Payload
defined using"Payload": ...
, e.g.,then context injection for the Step Function will fail with the error:
This is because our instrumentation code will add a field
"Payload.$": ...
, which duplicates with"Payload": ...
. Right now we only check for custom"Payload.$": ...
(with$
, i.e. using JSONPath) but don't check for custom"Payload": ...
.What
Also skip context injection when a custom
"Payload": ...
field is used (without$
)Testing
Automated testing
Pass the added test, which would fail without the changes on
helpers.ts
Manual testing
Steps:
Payload
field of a Lambda function to what's shown in "Problem" sectiondatadog-ci stepfunctions instrument
Result: a warning is printed as expected
Notes
Payload
field as long as it doesn't containExecution
orState
field inside. But I want to first merge this PR to make the existing behavior more clear, so the changes in future PRs will be more clear so the PRs will be easier to review.Review checklist