# MetricsConfigProperty

The metrics configuration for your event source.

Use this configuration object to define which metrics you want your event source mapping to produce.

- Source: Generated at build time
- Type last changed: v2.168.0 · 20 Nov 2024

## Example

TypeScript:

```ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_lambda as lambda } from 'aws-cdk-lib';
const metricsConfigProperty: lambda.CfnEventSourceMapping.MetricsConfigProperty = {
  metrics: ['metrics'],
};
```

Python:

```python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_lambda as lambda_

metrics_config_property = lambda.CfnEventSourceMapping.MetricsConfigProperty(
    metrics=["metrics"]
)
```

Java:

```java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.lambda.*;

MetricsConfigProperty metricsConfigProperty = MetricsConfigProperty.builder()
        .metrics(List.of("metrics"))
        .build();
```

C# / .NET:

```csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.Lambda;

var metricsConfigProperty = new MetricsConfigProperty {
    Metrics = new [] { "metrics" }
};
```

Golang:

```go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

metricsConfigProperty := &MetricsConfigProperty{
	Metrics: []*string{
		jsii.String("metrics"),
	},
}
```

## Properties

- `metrics`: string[] — The metrics you want your event source mapping to produce.

  Include `EventCount` to receive event source mapping metrics related to the number of events processed by your event source mapping. For more information about these metrics, see [Event source mapping metrics](https://docs.aws.amazon.com/lambda/latest/dg/monitoring-metrics-types.html#event-source-mapping-metrics) .
