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

[Step Function] 9. Update README #166

Merged
merged 1 commit into from
Jan 23, 2025

Conversation

lym953
Copy link
Contributor

@lym953 lym953 commented Jan 16, 2025

What does this PR do?

Update README by adding step function related doc.

Details:

  1. Add what this macro does to instrument a step function
  2. Add stepFunctionForwarderArn param, which is required for instrumenting a step function
  3. Update env, service, version, tags params, saying they will be set as tags on the step functions as well.
  4. Delete "How it works" section. I think it's largely the same as a paragraph at the beginning:

The macro automatically configures ingestion of metrics, traces, and logs from your serverless applications by: ...

Motivation

To make customers aware that this CloudFormation Macro will instrument their step functions as well.

Testing Guidelines

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 force-pushed the yiming.luo/step-function-24 branch from 71dc5f5 to df0e5f6 Compare January 17, 2025 17:31
@lym953 lym953 force-pushed the yiming.luo/step-function-25 branch from 3dc6515 to c9b1d3f Compare January 17, 2025 17:41
@lym953 lym953 marked this pull request as ready for review January 17, 2025 17:46
@lym953 lym953 requested review from a team as code owners January 17, 2025 17:46
Copy link

@estherk15 estherk15 left a comment

Choose a reason for hiding this comment

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

Left some suggestions to make the Configuration consistent.

- Installing and configuring the Datadog Lambda Library and Lambda Extension for your [Python][1], [Node.js][2], [.NET][9], and [Java][10] Lambda functions.
- Enabling the collection of enhanced Lambda metrics and custom metrics from your Lambda functions.
- Managing subscriptions from the Datadog Forwarder to your Lambda function log groups, if desired.
- For Lambda functions, this macro:

Choose a reason for hiding this comment

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

Suggested change
- For Lambda functions, this macro:
For Lambda functions, this macro:

- For Lambda functions, this macro:
- Installs and configures the Datadog Lambda Library and Lambda Extension for your [Python][1], [Node.js][2], [.NET][9], and [Java][10] Lambda functions.
- Enables the collection of enhanced Lambda metrics and custom metrics from your Lambda functions.
- Managing subscriptions from the Datadog Forwarder to your Lambda function log groups, if desired.

Choose a reason for hiding this comment

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

Suggested change
- Managing subscriptions from the Datadog Forwarder to your Lambda function log groups, if desired.
- Manages subscriptions from the Datadog Forwarder to your Lambda function log groups, if desired.

- Installs and configures the Datadog Lambda Library and Lambda Extension for your [Python][1], [Node.js][2], [.NET][9], and [Java][10] Lambda functions.
- Enables the collection of enhanced Lambda metrics and custom metrics from your Lambda functions.
- Managing subscriptions from the Datadog Forwarder to your Lambda function log groups, if desired.
- For Step Functions, this macro:

Choose a reason for hiding this comment

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

Suggested change
- For Step Functions, this macro:
For Step Functions, this macro:

- Managing subscriptions from the Datadog Forwarder to your Lambda function log groups, if desired.
- For Step Functions, this macro:
- Creates a log group and subscribes the Datadog forwarder Lambda to it.
- Adds tags to enable tracing and Unified Service Tagging

Choose a reason for hiding this comment

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

Suggested change
- Adds tags to enable tracing and Unified Service Tagging
- Adds tags to enable tracing and Unified Service Tagging.

@@ -41,7 +46,7 @@ aws cloudformation create-stack \

## Usage with AWS SAM

To deploy your serverless application with SAM, add the Datadog Serverless CloudFormation macro under the `Transform` section in your `template.yml` file, after the required SAM transform. Also add a `DDGitData` parameter and pass it to the macro to enable Datadog Source Code Integration:
To deploy your serverless application with SAM, add the Datadog Serverless CloudFormation macro under the `Transform` section in your `template.yml` file, after the required SAM transform. Also add a `DDGitData` parameter and pass it to the macro to enable Datadog Source Code Integration. Here is an example for instrumenting your Lambda functions and Step Functions:

Choose a reason for hiding this comment

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

Suggested change
To deploy your serverless application with SAM, add the Datadog Serverless CloudFormation macro under the `Transform` section in your `template.yml` file, after the required SAM transform. Also add a `DDGitData` parameter and pass it to the macro to enable Datadog Source Code Integration. Here is an example for instrumenting your Lambda functions and Step Functions:
To deploy your serverless application with SAM, add the Datadog Serverless CloudFormation macro under the `Transform` section in your `template.yml` file, after the required SAM transform. Add a `DDGitData` parameter passed to the macro to enable Datadog Source Code Integration. See the following example on instrumenting your Lambda functions and Step Functions:

| `tags` | A comma separated list of key:value pairs as a single string. When set along with `extensionLayerVersion`, a `DD_TAGS` environment variable is added on all Lambda functions with the provided value. When set along with `forwarderArn`, the macro parses the string and sets each key:value pair as a tag on all Lambda functions. The macro also sets these tags to all the State Machines. |
| `logLevel` | Sets the log level. Set to `DEBUG` for extended logging. |
| `captureLambdaPayload` | Automatically tags the function execution span with request and response payloads, so they can be displayed in the APM application. |
| `enableColdStartTracing` | Set to `false` to disable Cold Start Tracing. Used in NodeJS and Python. Defaults to `true`. |

Choose a reason for hiding this comment

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

Suggested change
| `enableColdStartTracing` | Set to `false` to disable Cold Start Tracing. Used in NodeJS and Python. Defaults to `true`. |
| `enableColdStartTracing` | Set to `false` to disable Cold Start Tracing. Used in Node.js and Python. Defaults to `true`. |

| `logLevel` | Sets the log level. Set to `DEBUG` for extended logging. |
| `captureLambdaPayload` | Automatically tags the function execution span with request and response payloads, so they can be displayed in the APM application. |
| `enableColdStartTracing` | Set to `false` to disable Cold Start Tracing. Used in NodeJS and Python. Defaults to `true`. |
| `coldStartTraceMinDuration` | Sets the minimum duration (in milliseconds) for a module load event to be traced via Cold Start Tracing. Number. Defaults to `3`. |

Choose a reason for hiding this comment

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

Is Number significant?

Suggested change
| `coldStartTraceMinDuration` | Sets the minimum duration (in milliseconds) for a module load event to be traced via Cold Start Tracing. Number. Defaults to `3`. |
| `coldStartTraceMinDuration` | Sets the minimum duration (in milliseconds) for a module load event to be traced through Cold Start Tracing. Defaults to `3`. |

| `captureLambdaPayload` | Automatically tags the function execution span with request and response payloads, so they can be displayed in the APM application. |
| `enableColdStartTracing` | Set to `false` to disable Cold Start Tracing. Used in NodeJS and Python. Defaults to `true`. |
| `coldStartTraceMinDuration` | Sets the minimum duration (in milliseconds) for a module load event to be traced via Cold Start Tracing. Number. Defaults to `3`. |
| `coldStartTraceSkipLibs` | optionally skip creating Cold Start Spans for a comma-separated list of libraries. Useful to limit depth or skip known libraries. Default depends on runtime. |

Choose a reason for hiding this comment

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

Suggested change
| `coldStartTraceSkipLibs` | optionally skip creating Cold Start Spans for a comma-separated list of libraries. Useful to limit depth or skip known libraries. Default depends on runtime. |
| `coldStartTraceSkipLibs` | Optionally skip creating Cold Start Spans for a comma-separated list of libraries. Useful to limit depth or skip known libraries. Default depends on runtime. |

| `enableColdStartTracing` | Set to `false` to disable Cold Start Tracing. Used in NodeJS and Python. Defaults to `true`. |
| `coldStartTraceMinDuration` | Sets the minimum duration (in milliseconds) for a module load event to be traced via Cold Start Tracing. Number. Defaults to `3`. |
| `coldStartTraceSkipLibs` | optionally skip creating Cold Start Spans for a comma-separated list of libraries. Useful to limit depth or skip known libraries. Default depends on runtime. |
| `enableProfiling` | Enable the Datadog Continuous Profiler with `true`. Supported in Beta for NodeJS and Python. Defaults to `false`. |

Choose a reason for hiding this comment

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

Suggested change
| `enableProfiling` | Enable the Datadog Continuous Profiler with `true`. Supported in Beta for NodeJS and Python. Defaults to `false`. |
| `enableProfiling` | Enable the Datadog Continuous Profiler with `true`. Supported in Beta for Node.js and Python. Defaults to `false`. |

Comment on lines 156 to 159
| `encodeAuthorizerContext` | When set to `true` for Lambda authorizers, the tracing context will be encoded into the response for propagation. Supported for NodeJS and Python. Defaults to `true`. |
| `decodeAuthorizerContext` | When set to `true` for Lambdas that are authorized via Lambda authorizers, it will parse and use the encoded tracing context (if found). Supported for NodeJS and Python. Defaults to `true`. |
| `apmFlushDeadline` | Used to determine when to submit spans before a timeout occurs, in milliseconds. When the remaining time in an AWS Lambda invocation is less than the value set, the tracer attempts to submit the current active spans and all finished spans. Supported for NodeJS and Python. Defaults to `100` milliseconds. |
| `stepFunctionForwarderArn` | When set, the forwarder will subscribe to all the State Machine' log groups. It is required for instrumenting Step Functions. |

Choose a reason for hiding this comment

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

Suggested change
| `encodeAuthorizerContext` | When set to `true` for Lambda authorizers, the tracing context will be encoded into the response for propagation. Supported for NodeJS and Python. Defaults to `true`. |
| `decodeAuthorizerContext` | When set to `true` for Lambdas that are authorized via Lambda authorizers, it will parse and use the encoded tracing context (if found). Supported for NodeJS and Python. Defaults to `true`. |
| `apmFlushDeadline` | Used to determine when to submit spans before a timeout occurs, in milliseconds. When the remaining time in an AWS Lambda invocation is less than the value set, the tracer attempts to submit the current active spans and all finished spans. Supported for NodeJS and Python. Defaults to `100` milliseconds. |
| `stepFunctionForwarderArn` | When set, the forwarder will subscribe to all the State Machine' log groups. It is required for instrumenting Step Functions. |
| `encodeAuthorizerContext` | When set to `true` for Lambda authorizers, the tracing context is encoded into the response for propagation. Supported for Node.js and Python. Defaults to `true`. |
| `decodeAuthorizerContext` | When set to `true` for Lambdas that are authorized through Lambda authorizers, it parses and use the encoded tracing context (if found). Supported for Node.js and Python. Defaults to `true`. |
| `apmFlushDeadline` | Used to determine when to submit spans before a timeout occurs, in milliseconds. When the remaining time in an AWS Lambda invocation is less than the value set, the tracer attempts to submit the current active spans and all finished spans. Supported for Node.js and Python. Defaults to `100` milliseconds. |
| `stepFunctionForwarderArn` | When set, the forwarder subscribes to all the State Machine' log groups. It is required for instrumenting Step Functions. |

@lym953 lym953 force-pushed the yiming.luo/step-function-25 branch from c9b1d3f to a734595 Compare January 21, 2025 19:49
Base automatically changed from yiming.luo/step-function-24 to yiming.luo/step-function January 23, 2025 16:31
@lym953 lym953 force-pushed the yiming.luo/step-function-25 branch from a734595 to b3274b8 Compare January 23, 2025 16:32
@lym953 lym953 merged commit 95fce93 into yiming.luo/step-function Jan 23, 2025
10 checks passed
@lym953 lym953 deleted the yiming.luo/step-function-25 branch January 23, 2025 16:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants