You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(lambda): support observability for ESM ( DDB, Kinesis, SQS) (#32204)
### Reason for this change
Lambda is introducing a new property in Event Sources named `MetricsConfig` to get enhanced metrics for user's event source that captures each stage of processing. Through this metrics customer can track flow of events through their EDA pipelines.
This feature is currently supported for `DynamoDB`, `Kinesis` and `SQS` event sources only.
### Description of changes
This new property can be opted in by setting the `MetricsConfig` field while creating event sources. The example of opting for `MetricsConfig` for dynamoDB event is shown below:
```
fn.addEventSource(new eventsources.DynamoEventSource(table, {
startingPosition: lambda.StartingPosition.LATEST,
metricsConfig: {
metrics: [MetricType.EVENT_COUNT],
}
}))
```
Today there is only 1 metric type: EventCount. The `metrics` array can be either one element with `EventCount` or an empty array. More configuration support will be available in future
### Description of how you validated changes
Have added unit test and integration test to validate the implementation
### Checklist
- [x] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md)
----
*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Copy file name to clipboardExpand all lines: packages/@aws-cdk-testing/framework-integ/test/aws-lambda-event-sources/test/integ.dynamodb-with-metrics-config.js.snapshot/cdk.out
Copy file name to clipboardExpand all lines: packages/@aws-cdk-testing/framework-integ/test/aws-lambda-event-sources/test/integ.dynamodb-with-metrics-config.js.snapshot/integ.json
Copy file name to clipboardExpand all lines: packages/@aws-cdk-testing/framework-integ/test/aws-lambda-event-sources/test/integ.dynamodb-with-metrics-config.js.snapshot/lambda-event-source-metrics-config-dynamodb.assets.json
Copy file name to clipboardExpand all lines: packages/@aws-cdk-testing/framework-integ/test/aws-lambda-event-sources/test/integ.dynamodb-with-metrics-config.js.snapshot/lambdaeventsourcedynamodbwithmetricsDefaultTestDeployAssertC1C197C4.assets.json
Copy file name to clipboardExpand all lines: packages/@aws-cdk-testing/framework-integ/test/aws-lambda-event-sources/test/integ.dynamodb-with-metrics-config.js.snapshot/lambdaeventsourcedynamodbwithmetricsDefaultTestDeployAssertC1C197C4.template.json
0 commit comments