Skip to content

Conversation

agocs
Copy link
Contributor

@agocs agocs commented Feb 15, 2024

What does this PR do?

Adds a plugin for AWS Stepfunctions that injects the datadog trace context into the input parameter of a startExecution or startSyncExecution request, if the input parameter is already a JSON object.

Screenshot of a datadog trace showing a JS lambda function invoking a Step Function.

image

Motivation

SVLS-4148

Serverless Integrations has added the ability to trace Stepfunction executions, and we want to be able to link Stepfunction executions with upstream traces. We do so by inspecting input._datadog in the Logs to Traces Reducer.

Plugin Checklist

  • Unit tests.

Security

Datadog employees:

  • If this PR touches code that signs or publishes builds or packages, or handles credentials of any kind, I've requested a review from @DataDog/security-design-and-guidance.
  • This PR doesn't touch any of that.

Unsure? Have a question? Request a review!

@github-actions
Copy link

github-actions bot commented Feb 15, 2024

Overall package size

Self size: 6.44 MB
Deduped: 60.93 MB
No deduping: 61.21 MB

Dependency sizes

name version self size total size
@datadog/native-iast-taint-tracking 1.7.0 16.71 MB 16.72 MB
@datadog/native-appsec 7.1.1 14.39 MB 14.4 MB
@datadog/pprof 5.2.0 8.84 MB 9.21 MB
protobufjs 7.2.5 2.77 MB 6.56 MB
@datadog/native-iast-rewriter 2.3.0 2.15 MB 2.24 MB
@opentelemetry/core 1.14.0 872.87 kB 1.47 MB
@datadog/native-metrics 2.0.0 898.77 kB 1.3 MB
@opentelemetry/api 1.4.1 780.32 kB 780.32 kB
import-in-the-middle 1.7.3 67.62 kB 731.01 kB
msgpack-lite 0.1.26 201.16 kB 281.59 kB
opentracing 0.14.7 194.81 kB 194.81 kB
semver 7.5.4 93.4 kB 123.8 kB
pprof-format 2.1.0 111.69 kB 111.69 kB
@datadog/sketches-js 2.1.0 109.9 kB 109.9 kB
lodash.sortby 4.7.0 75.76 kB 75.76 kB
lru-cache 7.14.0 74.95 kB 74.95 kB
ipaddr.js 2.1.0 60.23 kB 60.23 kB
ignore 5.2.4 51.22 kB 51.22 kB
int64-buffer 0.1.10 49.18 kB 49.18 kB
shell-quote 1.8.1 44.96 kB 44.96 kB
istanbul-lib-coverage 3.2.0 29.34 kB 29.34 kB
tlhunter-sorted-set 0.1.0 24.94 kB 24.94 kB
limiter 1.1.5 23.17 kB 23.17 kB
dc-polyfill 0.1.4 23.1 kB 23.1 kB
retry 0.13.1 18.85 kB 18.85 kB
node-abort-controller 3.1.1 16.89 kB 16.89 kB
jest-docblock 29.7.0 8.99 kB 12.76 kB
crypto-randomuuid 1.0.0 11.18 kB 11.18 kB
path-to-regexp 0.1.7 6.78 kB 6.78 kB
koalas 1.0.2 6.47 kB 6.47 kB
methods 1.1.2 5.29 kB 5.29 kB
module-details-from-path 1.0.3 4.47 kB 4.47 kB

🤖 This report was automatically generated by heaviest-objects-in-the-universe

@codecov
Copy link

codecov bot commented Feb 15, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 85.06%. Comparing base (c11fcfd) to head (546535f).
Report is 6 commits behind head on master.

❗ Current head 546535f differs from pull request most recent head 21971fc. Consider uploading reports for the commit 21971fc to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4069      +/-   ##
==========================================
+ Coverage   83.11%   85.06%   +1.95%     
==========================================
  Files         244      247       +3     
  Lines       10255    10950     +695     
  Branches       33       33              
==========================================
+ Hits         8523     9315     +792     
+ Misses       1732     1635      -97     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@pr-commenter
Copy link

pr-commenter bot commented Feb 15, 2024

Benchmarks

Benchmark execution time: 2024-04-30 17:17:41

Comparing candidate commit 21971fc in PR branch chris.agocs/inject_trace_context_into_stepfunction_executions with baseline commit 29f09b1 in branch master.

Found 0 performance improvements and 0 performance regressions! Performance is the same for 259 metrics, 7 unstable metrics.

@agocs agocs marked this pull request as ready for review February 19, 2024 21:26
@agocs agocs requested review from a team as code owners February 19, 2024 21:26
@agocs agocs requested a review from jbertran February 19, 2024 21:26
Copy link
Contributor

@jbertran jbertran left a comment

Choose a reason for hiding this comment

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

It seems localstack supports the step function API - can we have a few E2E tests that check the generated spans' shape?

nine5two7
nine5two7 previously approved these changes Mar 5, 2024
Copy link

@nine5two7 nine5two7 left a comment

Choose a reason for hiding this comment

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

LGTM

@agocs agocs dismissed stale reviews from Qard and nine5two7 via 4c42897 April 17, 2024 22:26
@agocs agocs requested a review from rochdev April 17, 2024 22:53
Copy link

@nine5two7 nine5two7 left a comment

Choose a reason for hiding this comment

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

LGTM

@agocs agocs dismissed rochdev’s stale review April 30, 2024 16:46

Changes made

@agocs
Copy link
Contributor Author

agocs commented Apr 30, 2024

/merge

@dd-devflow
Copy link

dd-devflow bot commented Apr 30, 2024

🚂 MergeQueue

This merge request is not mergeable yet, because of pending checks/missing approvals. It will be added to the queue as soon as checks pass and/or get approvals.
Note: if you pushed new commits since the last approval, you may need additional approval.
You can remove it from the waiting list with /remove command.

Use /merge -c to cancel this operation!

@agocs agocs requested a review from a team as a code owner April 30, 2024 17:05
@tlhunter tlhunter merged commit 5518693 into master Apr 30, 2024
@tlhunter tlhunter deleted the chris.agocs/inject_trace_context_into_stepfunction_executions branch April 30, 2024 17:24
@dd-devflow
Copy link

dd-devflow bot commented Apr 30, 2024

🚂 MergeQueue

This pull request was merged directly.

rochdev pushed a commit that referenced this pull request May 14, 2024
)

Adds a plugin for AWS Stepfunctions that injects the datadog trace context into the
input parameter of a startExecution or startSyncExecution request, if the input
parameter is already a JSON object. 

SVLS-4148

Serverless Integrations has added the ability to trace Stepfunction executions, and
we want to be able to link Stepfunction executions with upstream traces. We do so
by inspecting input._datadog in the Logs to Traces Reducer. 

---------

Co-authored-by: Jordi Bertran de Balanda <[email protected]>
Co-authored-by: Thomas Hunter II <[email protected]>
rochdev pushed a commit that referenced this pull request May 14, 2024
)

Adds a plugin for AWS Stepfunctions that injects the datadog trace context into the
input parameter of a startExecution or startSyncExecution request, if the input
parameter is already a JSON object.

SVLS-4148

Serverless Integrations has added the ability to trace Stepfunction executions, and
we want to be able to link Stepfunction executions with upstream traces. We do so
by inspecting input._datadog in the Logs to Traces Reducer.

---------

Co-authored-by: Jordi Bertran de Balanda <[email protected]>
Co-authored-by: Thomas Hunter II <[email protected]>
rochdev pushed a commit that referenced this pull request May 14, 2024
)

Adds a plugin for AWS Stepfunctions that injects the datadog trace context into the
input parameter of a startExecution or startSyncExecution request, if the input
parameter is already a JSON object.

SVLS-4148

Serverless Integrations has added the ability to trace Stepfunction executions, and
we want to be able to link Stepfunction executions with upstream traces. We do so
by inspecting input._datadog in the Logs to Traces Reducer.

---------

Co-authored-by: Jordi Bertran de Balanda <[email protected]>
Co-authored-by: Thomas Hunter II <[email protected]>
rochdev pushed a commit that referenced this pull request May 14, 2024
)

Adds a plugin for AWS Stepfunctions that injects the datadog trace context into the
input parameter of a startExecution or startSyncExecution request, if the input
parameter is already a JSON object. 

SVLS-4148

Serverless Integrations has added the ability to trace Stepfunction executions, and
we want to be able to link Stepfunction executions with upstream traces. We do so
by inspecting input._datadog in the Logs to Traces Reducer. 

---------

Co-authored-by: Jordi Bertran de Balanda <[email protected]>
Co-authored-by: Thomas Hunter II <[email protected]>
rochdev pushed a commit that referenced this pull request May 14, 2024
)

Adds a plugin for AWS Stepfunctions that injects the datadog trace context into the
input parameter of a startExecution or startSyncExecution request, if the input
parameter is already a JSON object.

SVLS-4148

Serverless Integrations has added the ability to trace Stepfunction executions, and
we want to be able to link Stepfunction executions with upstream traces. We do so
by inspecting input._datadog in the Logs to Traces Reducer.

---------

Co-authored-by: Jordi Bertran de Balanda <[email protected]>
Co-authored-by: Thomas Hunter II <[email protected]>
rochdev pushed a commit that referenced this pull request May 14, 2024
)

Adds a plugin for AWS Stepfunctions that injects the datadog trace context into the
input parameter of a startExecution or startSyncExecution request, if the input
parameter is already a JSON object.

SVLS-4148

Serverless Integrations has added the ability to trace Stepfunction executions, and
we want to be able to link Stepfunction executions with upstream traces. We do so
by inspecting input._datadog in the Logs to Traces Reducer.

---------

Co-authored-by: Jordi Bertran de Balanda <[email protected]>
Co-authored-by: Thomas Hunter II <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants