Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Set DD_TRACE_ENABLED tag on state machine #338

Merged
merged 1 commit into from
Nov 26, 2024

Conversation

lym953
Copy link
Contributor

@lym953 lym953 commented Nov 22, 2024

What does this PR do?

When instrumenting a state machine, sets DD_TRACE_ENABLED tag to true. This is needed to enable tracing.

Aligned with @nine5two7 that we always set it to true for now. If any customer wants to customize it, we can support it later.

Motivation

Testing Guidelines

Automated testing

  1. Passed the touched jest test.
  2. Run UPDATE_SNAPSHOTS=true aws-vault exec sso-serverless-sandbox-account-admin -- ./scripts/run_integration_tests.sh, and the snapshots in the snapshot tests are updated.

Manual testing

Steps
  1. Deploy the example stack step-functions-typescript-stack.
  2. Run the state machine from AWS UI.
Result
  1. On AWS UI, this tag is added:
image
  1. Traces are shown on Datadog app
image

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

@lym953 lym953 marked this pull request as ready for review November 22, 2024 20:07
@lym953 lym953 requested a review from a team as a code owner November 22, 2024 20:07
@@ -24,6 +24,10 @@
"Key": "custom-tag-2",
"Value": "tag-value-2"
},
{
"Key": "DD_STEP_FUNCTIONS_TRACE_ENABLED",

Choose a reason for hiding this comment

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

DD_STEP_FUNCTIONS_TRACE_ENABLED is used at the DD Forwarder, to enable Forwarder level trace enablement for SFs. For each individual SF, you need to use DD_TRACE_ENABLED instead of DD_STEP_FUNCTIONS_TRACE_ENABLED. In addition, we probably should only allow customer to enable DD_STEP_FUNCTIONS_TRACE_ENABLED at the DD forwarder manually instead of via any ci/plugin/cdk tools when deploying an individual Step Functions.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You are right. I set a wrong tag. Will fix.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@nine5two7 Fixed!

Choose a reason for hiding this comment

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

Later, we need to mention in the public documentation that this value is set to "true" by default. Customers can manually disable it in the AWS console. @lym953

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point. I will add it to README first. I'll mention @cswatt in that PR so she knows to also add it to public doc.

@lym953 lym953 marked this pull request as draft November 25, 2024 22:03
@lym953 lym953 force-pushed the yiming.luo/step-function-support-8 branch 2 times, most recently from 43568dd to 6e22a20 Compare November 25, 2024 22:49
@lym953 lym953 changed the title feat: Set DD_STEP_FUNCTIONS_TRACE_ENABLED tag on state machine feat: Set DD_TRACE_ENABLED tag on state machine Nov 25, 2024
@lym953 lym953 marked this pull request as ready for review November 25, 2024 23:33
@lym953 lym953 force-pushed the yiming.luo/step-function-support-8 branch from 6e22a20 to e190c49 Compare November 26, 2024 18:11
@lym953
Copy link
Contributor Author

lym953 commented Nov 26, 2024

/merge

@dd-devflow
Copy link

dd-devflow bot commented Nov 26, 2024

Devflow running: /merge

View all feedbacks in Devflow UI.


2024-11-26 18:11:24 UTC ℹ️ MergeQueue: pull request added to the queue

The median merge time in main is 8m.

@dd-mergequeue dd-mergequeue bot merged commit 8fcf1e1 into main Nov 26, 2024
13 checks passed
@dd-mergequeue dd-mergequeue bot deleted the yiming.luo/step-function-support-8 branch November 26, 2024 18:20
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.

2 participants