interface MetricsConfig
Language | Type name |
---|---|
.NET | Amazon.CDK.AWS.Lambda.MetricsConfig |
Go | github.com/aws/aws-cdk-go/awscdk/v2/awslambda#MetricsConfig |
Java | software.amazon.awscdk.services.lambda.MetricsConfig |
Python | aws_cdk.aws_lambda.MetricsConfig |
TypeScript (source) | aws-cdk-lib » aws_lambda » MetricsConfig |
Configuration for collecting metrics from the event source.
Example
import * as eventsources from 'aws-cdk-lib/aws-lambda-event-sources';
import * as dynamodb from 'aws-cdk-lib/aws-dynamodb';
declare const fn: lambda.Function;
const table = new dynamodb.Table(this, 'Table', {
partitionKey: {
name: 'id',
type: dynamodb.AttributeType.STRING,
},
stream: dynamodb.StreamViewType.NEW_IMAGE,
});
fn.addEventSource(new eventsources.DynamoEventSource(table, {
startingPosition: lambda.StartingPosition.LATEST,
metricsConfig: {
metrics: [lambda.MetricType.EVENT_COUNT],
}
}));
Properties
Name | Type | Description |
---|---|---|
metrics | Metric [] | List of metric types to enable for this event source. |
metrics
Type:
Metric
[]
List of metric types to enable for this event source.