# MetricType

- Source: [`aws-lambda/lib/event-source-mapping.ts`](https://github.com/aws/aws-cdk/blob/v2.275.0/packages/aws-cdk-lib/aws-lambda/lib/event-source-mapping.ts#L394)
- Type last changed: v2.237.0 · 2 Feb 2026

## Example

```ts
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],
  }
}));
```

## Members

| Member | Description |
| --- | --- |
| `EVENT_COUNT` | Event Count metrics provide insights into the processing behavior of your event source mapping, including the number of events successfully processed, filtered out, or dropped. |
| `ERROR_COUNT` | Error Count metrics provide insights into invocation errors and failures in your event source mapping processing. |
| `KAFKA_METRICS` | Kafka-specific metrics provide detailed insights into Kafka consumer behavior, including lag, throughput, and partition-specific metrics. |

## Referenced by

- [`MetricsConfig`](/v2/docs/aws-cdk-lib.aws_lambda.MetricsConfig).metrics
