Skip to content
v2.278.0

MetricProperty Struct ​

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

Example ​

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
# 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
// 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();
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"
};
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 ​

dimensionsoptionalIResolvable | IResolvable | CfnServiceLevelObjective.DimensionProperty[]dimensionsoptionaltyping.Union[IResolvable, typing.List[typing.Union[IResolvable, DimensionProperty]]]dimensionsoptionalIResolvableDimensionsoptionalIResolvableDimensionsoptionalinterface{} #
An array of one or more dimensions to use to define the metric that you want to use.

For more information, see Dimensions .

metricNameoptionalstringmetric_nameoptionalstrmetricNameoptionalStringMetricNameoptionalstringMetricNameoptional*string #
The name of the metric to use.
namespaceoptionalstringnamespaceoptionalstrnamespaceoptionalStringNamespaceoptionalstringNamespaceoptional*string #
The namespace of the metric.

For more information, see Namespaces .