# MetricSourceProperty

Configuration for identifying the source of metrics for non-Application Signals services.

- Source: Generated at build time
- Type last changed: v2.258.0 · 4 Jun 2026

## 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 metricSourceProperty: applicationsignals.CfnServiceLevelObjective.MetricSourceProperty = {
  metricSourceKeyAttributes: {
    metricSourceKeyAttributesKey: 'metricSourceKeyAttributes',
  },

  // the properties below are optional
  metricSourceAttributes: {
    metricSourceAttributesKey: 'metricSourceAttributes',
  },
};
```

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_source_property = applicationsignals.CfnServiceLevelObjective.MetricSourceProperty(
    metric_source_key_attributes={
        "metric_source_key_attributes_key": "metricSourceKeyAttributes"
    },

    # the properties below are optional
    metric_source_attributes={
        "metric_source_attributes_key": "metricSourceAttributes"
    }
)
```

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

MetricSourceProperty metricSourceProperty = MetricSourceProperty.builder()
        .metricSourceKeyAttributes(Map.of(
                "metricSourceKeyAttributesKey", "metricSourceKeyAttributes"))

        // the properties below are optional
        .metricSourceAttributes(Map.of(
                "metricSourceAttributesKey", "metricSourceAttributes"))
        .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 metricSourceProperty = new MetricSourceProperty {
    MetricSourceKeyAttributes = new Dictionary<string, string> {
        { "metricSourceKeyAttributesKey", "metricSourceKeyAttributes" }
    },

    // the properties below are optional
    MetricSourceAttributes = new Dictionary<string, string> {
        { "metricSourceAttributesKey", "metricSourceAttributes" }
    }
};
```

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"

metricSourceProperty := &MetricSourceProperty{
	MetricSourceKeyAttributes: map[string]*string{
		"metricSourceKeyAttributesKey": jsii.String("metricSourceKeyAttributes"),
	},

	// the properties below are optional
	MetricSourceAttributes: map[string]*string{
		"metricSourceAttributesKey": jsii.String("metricSourceAttributes"),
	},
}
```

## Properties

- `metricSourceAttributes`: [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | { [key: string]: string } — Optional additional attributes for the metric source.

- `metricSourceKeyAttributes`: [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | { [key: string]: string } (required) — Required attributes that identify the metric source.
