Skip to content

Conversation

@avedmala
Copy link
Contributor

@avedmala avedmala commented Aug 9, 2024

What does this PR do?

Step Function events that are from Legacy Lambda enter the layer wrapped in a Payload: {}. Here's an example

{'Payload': {'Execution': {'Id': 'arn:aws:states:sa-east-1:425362996713:execution:abhinav-legacy-lam-sf:ca7383bc-e370-4a85-a266-a4686bd7d00f', 'Input': {}, 'StartTime': '2024-08-08T18:55:03.805Z', 'Name': 'ca7383bc-e370-4a85-a266-a4686bd7d00f', 'RoleArn': 'arn:aws:iam::425362996713:role/service-role/StepFunctions-abhinav-test-1-role-4u48d0717', 'RedriveCount': 0}, 'StateMachine': {'Id': 'arn:aws:states:sa-east-1:425362996713:stateMachine:abhinav-legacy-lam-sf', 'Name': 'abhinav-legacy-lam-sf'}, 'State': {'Name': 'Lambda Invoke', 'EnteredTime': '2024-08-08T18:55:03.847Z', 'RetryCount': 0}}} 

This change will check if events fall into this case and parse them accordingly so that we can extract the trace context and infer a span link between the Step Function and the downstream Legacy Lambda

Motivation

https://github.com/DataDog/logs-backend/pull/78707

Testing Guidelines

  • Link to a Step Functions trace with a linked lambda span using this version of the js layer
  • Added unit test cases with legacy lambda payload

Additional Notes

Types of Changes

  • Bug fix
  • New feature
  • Breaking change
  • Misc (docs, refactoring, dependency upgrade, etc.)

Check all that apply

  • This PR's description is comprehensive
  • This PR contains breaking changes that are documented in the description
  • This PR introduces new APIs or parameters that are documented and unlikely to change in the foreseeable future
  • This PR impacts documentation, and it has been updated (or a ticket has been logged)
  • This PR's changes are covered by the automated tests
  • This PR collects user input/sensitive content into Datadog
  • This PR passes the integration tests (ask a Datadog member to run the tests)
@avedmala avedmala marked this pull request as ready for review August 9, 2024 18:09
@avedmala avedmala requested a review from a team as a code owner August 9, 2024 18:09
Copy link
Contributor

@joeyzhao2018 joeyzhao2018 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚢

Co-authored-by: jordan gonzález <30836115+duncanista@users.noreply.github.com>
@avedmala avedmala merged commit 5e29f63 into main Aug 9, 2024
@avedmala avedmala deleted the avedmala/sf-legacy-lambda-span-link branch August 9, 2024 20:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

4 participants