DataDog / datadog-lambda-js

The Datadog AWS Lambda Library for Node
Apache License 2.0
113 stars 35 forks source link

Step Functions Trace Merging Support #588

Closed avedmala closed 4 days ago

avedmala commented 1 week ago

What does this PR do?

Allows us to do multi-level trace merging between Step Functions and Node Lambda functions

multi-level trace merging

Screenshot 2024-11-15 at 3 00 58 PM

Added logic to extract trace context from _datadog for Step Functions cases where...

  1. Root of the overall execution is a Lambda. This means we have the x-datadog-trace-id and x-datadog-tags but we need to compute the parentID using parent SFN context object
  2. Root of the overall execution is another Step Function. This means we need to compute both traceID and parentID from RootExecutionId and the parent SFN context object
  3. Legacy case where there's no _datadog and we instead figure out traceID and parentID from the parent SFN context object

live testing

  1. Lambda1 --> SFN --> Lambda2 trace a. Lambda1 is actually in Python, cool how we can mix and match runtimes
  2. SFN --> Lambda trace

trigger tag improvements

Also fixed the trigger tags parsing for our use case!

Screenshot 2024-11-18 at 10 41 44 AM

Motivation

Testing Guidelines

Additional Notes

Types of Changes

Check all that apply