> **Experimental**
>
> `@aws-cdk/aws-mediaconnect-alpha` is an [**experimental**](/stability) (alpha) package: its API may change in any release, without a major version bump.
# MonitoringMetric

Configures a source monitoring metric.

- Stability: [Experimental](/cdk/api/stability.html)
- Source: [`lib/flow.ts`](https://github.com/aws/aws-cdk/blob/v2.277.0/packages/@aws-cdk/aws-mediaconnect-alpha/lib/flow.ts#L351)

## Example

TypeScript:

```ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import * as mediaconnect_alpha from '@aws-cdk/aws-mediaconnect-alpha';
import * as cdk from 'aws-cdk-lib';
const monitoringMetric: mediaconnect_alpha.MonitoringMetric = {
  state: mediaconnect_alpha.State.ENABLED,
  threshold: cdk.Duration.minutes(30),
};
```

Python:

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

monitoring_metric = mediaconnect_alpha.MonitoringMetric(
    state=mediaconnect_alpha.State.ENABLED,
    threshold=cdk.Duration.minutes(30)
)
```

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.mediaconnect.alpha.*;
import software.amazon.awscdk.*;

MonitoringMetric monitoringMetric = MonitoringMetric.builder()
        .state(State.ENABLED)
        .threshold(Duration.minutes(30))
        .build();
```

C# / .NET:

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

var monitoringMetric = new MonitoringMetric {
    State = State.ENABLED,
    Threshold = Duration.Minutes(30)
};
```

Golang:

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

monitoringMetric := &MonitoringMetric{
	State: mediaconnect_alpha.State_ENABLED,
	Threshold: cdk.Duration_Minutes(jsii.Number(30)),
}
```

## Properties

- `state`: [State](/cdk/api/v2/docs/@aws-cdk_aws-mediaconnect-alpha.State.html) (required) — Whether the metric is enabled or disabled.

  The threshold is persisted by the
  service either way, so you can toggle the metric on and off without losing
  the threshold value.

- `threshold`: [Duration](/cdk/api/v2/docs/aws-cdk-lib.Duration.html) (required) — Threshold in seconds that triggers the metric's alert.

  Valid range: 10–60 seconds.
