# MetricProperty

Represents a specific metric.

- Source: Generated at build time
- Type last changed: v2.93.0 · 23 Aug 2023

## Example

TypeScript:

```ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_cloudwatch as cloudwatch } from 'aws-cdk-lib';
const metricProperty: cloudwatch.CfnAnomalyDetector.MetricProperty = {
  metricName: 'metricName',
  namespace: 'namespace',

  // the properties below are optional
  dimensions: [{
    name: 'name',
    value: 'value',
  }],
};
```

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_cloudwatch as cloudwatch

metric_property = cloudwatch.CfnAnomalyDetector.MetricProperty(
    metric_name="metricName",
    namespace="namespace",

    # the properties below are optional
    dimensions=[cloudwatch.CfnAnomalyDetector.DimensionProperty(
        name="name",
        value="value"
    )]
)
```

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.cloudwatch.*;

MetricProperty metricProperty = MetricProperty.builder()
        .metricName("metricName")
        .namespace("namespace")

        // the properties below are optional
        .dimensions(List.of(DimensionProperty.builder()
                .name("name")
                .value("value")
                .build()))
        .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.CloudWatch;

var metricProperty = new MetricProperty {
    MetricName = "metricName",
    Namespace = "namespace",

    // the properties below are optional
    Dimensions = new [] { new DimensionProperty {
        Name = "name",
        Value = "value"
    } }
};
```

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"

metricProperty := &MetricProperty{
	MetricName: jsii.String("metricName"),
	Namespace: jsii.String("namespace"),

	// the properties below are optional
	Dimensions: []interface{}{
		&DimensionProperty{
			Name: jsii.String("name"),
			Value: jsii.String("value"),
		},
	},
}
```

## Properties

- `dimensions`: [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnAnomalyDetector.DimensionProperty](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_cloudwatch.CfnAnomalyDetector.DimensionProperty.html)[] — The dimensions for the metric.

- `metricName`: string (required) — The name of the metric.

  This is a required field.

- `namespace`: string (required) — The namespace of the metric.
