# MetricProperty

This structure defines the metric used for a service level indicator, including the metric name, namespace, and dimensions.

- Source: Generated at build time
- Type last changed: v2.147.0 · 20 Jun 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_applicationsignals as applicationsignals } from 'aws-cdk-lib';
const metricProperty: applicationsignals.CfnServiceLevelObjective.MetricProperty = {
  dimensions: [{
    name: 'name',
    value: 'value',
  }],
  metricName: 'metricName',
  namespace: 'namespace',
};
```

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_applicationsignals as applicationsignals

metric_property = applicationsignals.CfnServiceLevelObjective.MetricProperty(
    dimensions=[applicationsignals.CfnServiceLevelObjective.DimensionProperty(
        name="name",
        value="value"
    )],
    metric_name="metricName",
    namespace="namespace"
)
```

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

MetricProperty metricProperty = MetricProperty.builder()
        .dimensions(List.of(DimensionProperty.builder()
                .name("name")
                .value("value")
                .build()))
        .metricName("metricName")
        .namespace("namespace")
        .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.ApplicationSignals;

var metricProperty = new MetricProperty {
    Dimensions = new [] { new DimensionProperty {
        Name = "name",
        Value = "value"
    } },
    MetricName = "metricName",
    Namespace = "namespace"
};
```

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{
	Dimensions: []interface{}{
		&DimensionProperty{
			Name: jsii.String("name"),
			Value: jsii.String("value"),
		},
	},
	MetricName: jsii.String("metricName"),
	Namespace: jsii.String("namespace"),
}
```

## 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) | [CfnServiceLevelObjective.DimensionProperty](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_applicationsignals.CfnServiceLevelObjective.DimensionProperty.html)[] — An array of one or more dimensions to use to define the metric that you want to use.

  For more information, see [Dimensions](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/cloudwatch_concepts.html#Dimension) .

- `metricName`: string — The name of the metric to use.

- `namespace`: string — The namespace of the metric.

  For more information, see [Namespaces](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/cloudwatch_concepts.html#Namespace) .
