diff --git a/config/_default/menus/main.en.yaml b/config/_default/menus/main.en.yaml index f57a10dc630..b0e338b2c60 100644 --- a/config/_default/menus/main.en.yaml +++ b/config/_default/menus/main.en.yaml @@ -3600,66 +3600,71 @@ menu: parent: serverless_aws_lambda identifier: serverless_aws_lambda_managed_instances weight: 102 + - name: Durable Functions + url: serverless/aws_lambda/durable_functions + parent: serverless_aws_lambda + identifier: serverless_aws_lambda_durable_functions + weight: 103 - name: Lambda Metrics url: serverless/aws_lambda/metrics parent: serverless_aws_lambda identifier: serverless_aws_lambda_metrics - weight: 103 + weight: 104 - name: Distributed Tracing url: serverless/aws_lambda/distributed_tracing identifier: serverless_distributed_tracing parent: serverless_aws_lambda - weight: 104 + weight: 105 - name: Log Collection url: serverless/aws_lambda/logs identifier: serverless_aws_lambda_logs parent: serverless_aws_lambda - weight: 105 + weight: 106 - name: Remote Instrumentation url: serverless/aws_lambda/remote_instrumentation identifier: serverless_aws_lambda_remote_instrumentation parent: serverless_aws_lambda - weight: 106 + weight: 107 - name: Advanced Configuration url: serverless/aws_lambda/configuration parent: serverless_aws_lambda identifier: serverless_configuration - weight: 107 + weight: 108 - name: Continuous Profiler url: serverless/aws_lambda/profiling parent: serverless_aws_lambda identifier: serverless_aws_lambda_continuous_profiler - weight: 108 + weight: 109 - name: Securing Functions url: /serverless/aws_lambda/securing_functions parent: serverless_aws_lambda identifier: serverless_aws_lambda_securing_functions - weight: 109 + weight: 110 - name: Deployment Tracking url: serverless/aws_lambda/deployment_tracking parent: serverless_aws_lambda identifier: serverless_aws_lambda_deployment_tracking - weight: 110 + weight: 111 - name: OpenTelemetry url: serverless/aws_lambda/opentelemetry parent: serverless_aws_lambda identifier: serverless_aws_lambda_opentelemetry - weight: 111 + weight: 112 - name: Troubleshooting url: serverless/aws_lambda/troubleshooting parent: serverless_aws_lambda identifier: serverless_aws_lambda_troubleshooting - weight: 112 + weight: 113 - name: Lambda Web Adapter url: serverless/aws_lambda/lwa parent: serverless_aws_lambda identifier: serverless_aws_lambda_lwa - weight: 113 + weight: 114 - name: FIPS Compliance url: serverless/aws_lambda/fips-compliance parent: serverless_aws_lambda identifier: serverless_aws_lambda_fips_compliance - weight: 114 + weight: 115 - name: AWS Step Functions url: serverless/step_functions parent: serverless_aws diff --git a/content/en/serverless/aws_lambda/durable_functions.md b/content/en/serverless/aws_lambda/durable_functions.md new file mode 100644 index 00000000000..b79cee95824 --- /dev/null +++ b/content/en/serverless/aws_lambda/durable_functions.md @@ -0,0 +1,76 @@ +--- + +title: Monitoring AWS Lambda Durable Functions +description: Set up Datadog Serverless Monitoring for AWS Lambda Durable Functions. + +--- + +Datadog provides full visibility into the metrics, logs, and traces for AWS Lambda Durable Function executions. In a single view, you can monitor your AWS Lambda Durable Functions alongside your other serverless compute services to spot bottlenecks and fix errors. + +**Supported runtimes:** Node.js + +## Setup + +### Instrument your Lambda function + +1. Follow [the steps for instrumenting a Lambda function][1], confirming that the Datadog Lambda Library is installed and tracing is enabled. Use the following versions: + + - Datadog Lambda Extension: v98+ + - Datadog Node.js Lambda layer: v141+ + +2. Set the following environment variable on your Lambda function: + + ```text + DD_LAMBDA_DURABLE_FUNCTION_LOG_BUFFER_SIZE=5 + ``` + + This environment variable configures the Datadog Lambda Extension to buffer logs and enrich them with the durable execution context sent by the Datadog Lambda Library. Set its value to a non-negative integer specifying the maximum number of invocations whose logs are buffered. The default, `0`, disables enrichment, so durable executions do not appear in Datadog. + +### Forward durable execution events + +**Deploy the CloudFormation stack** + +To forward durable execution status change events to Datadog, deploy the CloudFormation stack to your AWS account: + +1. Log in to the AWS account and region where your durable functions run, then click **Launch Stack** to open the stack: + + [![Launch Stack](https://s3.amazonaws.com/cloudformation-examples/cloudformation-launch-stack.png)][2] + +2. Provide your Datadog API key using exactly one of the following parameters: + + - `DdApiKey`: your [Datadog API key][3] in plaintext + - `DdApiKeySecretArn`: the ARN of an AWS Secrets Manager secret whose value is your Datadog API key + - `DdApiKeySsmParameterName`: the name of an AWS Systems Manager Parameter Store `SecureString` parameter that holds your Datadog API key + +3. Set `DdSite` to your [Datadog site][4]. The default is `datadoghq.com`. +4. Optionally, restrict which events are forwarded: + + - `Statuses`: a comma-separated list of execution statuses to forward. Valid values are `RUNNING`, `SUCCEEDED`, `FAILED`, `TIMED_OUT`, and `STOPPED`. Leave this empty to forward all statuses. + - `FunctionArnFilter1` through `FunctionArnFilter5`: up to five unqualified Lambda function ARNs or EventBridge wildcard patterns, such as `arn:aws:lambda:us-east-2:123456789012:function:my-durable-*`. Do not include a version or alias suffix. Leave all five empty to forward events from every function in the region. + - `BufferIntervalSeconds`: the Amazon Data Firehose buffer interval, in seconds (`60`-`900`, default `60`). Higher values reduce the number of outbound requests at the cost of freshness. + +5. Click **Create stack** and wait for the stack to finish creating. +6. If your durable functions run in multiple AWS regions, repeat these steps in each region. + +**Install the AWS Lambda integration** + +In Datadog, install the [AWS Lambda integration][5], which provides the out-of-the-box logs pipeline that transforms the forwarded events. + +### Create a trace retention filter + +Create a [trace retention filter][6] with the retention query `operation_name:aws.durable.execute`. + +## Limitations and feedback + +Runtimes other than Node.js are not supported. If you encounter an issue with another runtime, open an issue in the [datadog-lambda-extension GitHub repository][7]. + +If you encounter an issue with the CloudFormation stack, open an issue in the [cloudformation-template GitHub repository][8]. + +[1]: /serverless/aws_lambda/instrumentation +[2]: https://console.aws.amazon.com/cloudformation/home#/stacks/create/review?stackName=datadog-durable-function-event-forwarder&templateURL=https://datadog-cloudformation-template.s3.amazonaws.com/aws/lambda-durable-function-event-forwarder/latest.yaml +[3]: /account_management/api-app-keys/#api-keys +[4]: /getting_started/site/ +[5]: /integrations/amazon_lambda/ +[6]: /tracing/trace_pipeline/trace_retention/#create-your-own-retention-filter +[7]: https://github.com/DataDog/datadog-lambda-extension +[8]: https://github.com/DataDog/cloudformation-template/tree/master/aws_durable_function_event_forwarder \ No newline at end of file