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

DOCS-9587: restructure step functions install page #26825

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

cswatt
Copy link
Contributor

@cswatt cswatt commented Dec 17, 2024

What does this PR do? What is the motivation?

work in progress

Merge instructions

Merge readiness:

  • Ready for merge

Merge queue is enabled in this repo. To have it automatically merged after it receives the required reviews, create the PR (from a branch that follows the <yourname>/description naming convention) and then add the following PR comment:

/merge

Additional notes

@cswatt cswatt added the WORK IN PROGRESS No review needed, it's a wip ;) label Dec 17, 2024
@cswatt cswatt requested review from a team as code owners December 17, 2024 22:50
Copy link
Contributor

@lym953 lym953 left a comment

Choose a reason for hiding this comment

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

Thanks for improving the doc!


For more information about the `datadog-ci stepfunctions` command, see the [Datadog CLI documentation][4].

1. Set up tags. Open your AWS console and go to your Step Functions state machine. Open the *Tags* section and add the following key-value pairs:
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think this manual step is needed. datadog-ci command will add these tags. Is this section copied from somewhere?

| `dd_version` | `dd_sls_plugin`|

1. To enable tracing, you have two options:
- **Per Step Function**: Add the `DD_TRACE_ENABLED` tag to each Step Function and set the value to `true`.
Copy link
Contributor

Choose a reason for hiding this comment

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

We can add something like: The datadog-ci stepfunctions instrument command already does this, so no extra work is needed.


For additional settings, see [Datadog Serverless Framework Plugin - Configuration parameters][5].

1. Set up tags. Open your AWS console and go to your Step Functions state machine. Open the *Tags* section and add the following key-value pairs:
Copy link
Contributor

Choose a reason for hiding this comment

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

This is not needed. Serverless Plugin will set these tags.

| `dd_version` | `dd_sls_ci`|

1. To enable tracing, you have two options:
- **Per Step Function**: Add the `DD_TRACE_ENABLED` tag to each Step Function and set the value to `true`.
Copy link
Contributor

Choose a reason for hiding this comment

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

We only need to add enableStepFunctionsTracing: true, as shown in the example code above.

Comment on lines 176 to 180
```
/aws/vendedlogs/states/<CDK_PATH>-Logs
```

**Optionally**, you can add your environment to this log group name: `/aws/vendedlogs/states/<CDK_PATH>-Logs-<ENV>`
Copy link
Contributor

Choose a reason for hiding this comment

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

With CDK, the user won't need to create the log group on their own.
Also, the instructions for CDK are incomplete. Is there a plan to write this part in a separate PR?

@cswatt cswatt requested a review from a team as a code owner January 28, 2025 20:12
@github-actions github-actions bot added the Guide Content impacting a guide label Jan 28, 2025

[1]: https://github.com/DataDog/datadog-cdk-constructs/tree/main/examples/step-functions-python-stack
{{% /tab %}}
{{% tab "Go" %}}
Copy link
Contributor

Choose a reason for hiding this comment

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

Just a question, but do we only have the official CDK constructs available in Go, TS and Python? And no support for .NET/Java right?

Copy link
Contributor

Choose a reason for hiding this comment

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

That's right. I added Go in August 2024. Let me know if there's a need to support .NET or Java.

Copy link
Contributor

Choose a reason for hiding this comment

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

.NET & Java definitely aren't as widely used, I'm just thinking for completeness that's all. So we can say we support all runtimes.

Is there not a way with the CDK to write it once in Javascript and then auto-gen the other runtimes though?

Copy link
Contributor

Choose a reason for hiding this comment

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

This is a CDK construct for defining .NET Lambda functions. The construct is defined once in Typescript and then uses Projen to generate all the other packages. Could we not do the same for our constructs?

https://github.com/cdklabs/awscdk-lambda-dotnet/blob/main/.github/workflows/release.yml

Copy link
Contributor

@lym953 lym953 Feb 12, 2025

Choose a reason for hiding this comment

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

Yes, I think it's 1–2 week one-time work to support a new language.
From what I understand, we often use a "lazy" approach that we don't build something until some customer asks for it. Have you heard of any customer ask, or could you align with Sumedha on this?

@jeastham1993
Copy link
Contributor

jeastham1993 commented Feb 12, 2025

I like the write-up, some more general added separately to make the conversation easier :)

Do we want to add an example in Terraform as well? Maybe not so useful for serverless app developers, but I've seen a lot of usage of StepFunctions for infra/platform level tasks (account provisioning etc). Ancedotally, folks doing those kind of tasks may want to use Terraform. I've got TF examples in my serverless sample app and you'd only need one to cover all runtimes

@jeastham1993
Copy link
Contributor

I think we should add some content on how a .NET or Java developer would do this. Even if we don't have the Datadog SFN CDK construct it would be good to get specific to show a .NET/Java developer how they would do it in the CDK. Again I have examples in my sample app repo if you want me to share.

@jeastham1993
Copy link
Contributor

I don't see anything about AWS SAM, but it might be that SAM is already in the docs and not relevant for this PR.

Copy link
Contributor

@lym953 lym953 left a comment

Choose a reason for hiding this comment

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

Otherwise LGTM! I like this new structure.

jsii.String("DatadogSfn"),
&ddcdkconstruct.DatadogStepFunctionsProps{
Env: jsii.String("<ENV>"), // e.g. "dev"
Service: jsii.String("<SERVICE>), // e.g. "my-cdk-service"
Copy link
Contributor

Choose a reason for hiding this comment

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

"<SERVICE>" misses a quote. Could you correct it here? Sorry I missed it in the original README.


Take note of your Forwarder's ARN.

1. Add the following to your `serverless.yml`:
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this should be something like

Run the following command:

or just

Run:

Only the Serverless Plugin approach has serverless.yml.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

whoops, copy/paste error. correcting

@lym953
Copy link
Contributor

lym953 commented Feb 12, 2025

I think we should add some content on how a .NET or Java developer would do this. Even if we don't have the Datadog SFN CDK construct it would be good to get specific to show a .NET/Java developer how they would do it in the CDK.

I don't know a good way for a .NET/Java developer. I think we can add something like:

If you want our CDK library to be available in .NET or Java, please open an issue in https://github.com/DataDog/datadog-cdk-constructs/issues so we can hear you and support it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Guide Content impacting a guide WORK IN PROGRESS No review needed, it's a wip ;)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants