

# Monitoring with Amazon EventBridge events
Monitoring with EventBridge eventsHealth EventBridge events

New flow, source, and output health monitoring EventBridge events have been added to MediaConnect. 

EventBridge enables you to automate your AWS services and respond automatically to system events such as application availability issues or resource changes. Events from AWS services are delivered to EventBridge in near real time. You can write simple rules to indicate which events are of interest to you, and what automated actions to take when an event matches a rule.

The actions that can be automatically triggered using EventBridge include the following:
+ Invoking an AWS Lambda function
+ Invoking Amazon EC2 Run Command
+ Relaying the event to Amazon Kinesis Data Streams
+ Activating an AWS Step Functions state machine
+ Notifying an Amazon SNS topic or an Amazon SQS queue

For more information, see the [Amazon EventBridge User Guide](https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-what-is.html).

**Topics**
+ [

# MediaConnect flow state change event
](monitoring-cloudwatch-events-flow-state-change.md)
+ [

# MediaConnect flow maintenance event
](monitoring-cloudwatch-events-flow-maintenance.md)
+ [

# MediaConnect flow health event
](monitoring-cloudwatch-events-flow-health.md)
+ [

# MediaConnect alert event
](monitoring-cloudwatch-events-alert.md)
+ [

# MediaConnect source health event
](monitoring-cloudwatch-events-source-health.md)
+ [

# MediaConnect output health event
](monitoring-cloudwatch-events-output-health.md)
+ [

# MediaConnect flow content quality event
](monitoring-eventbridge-events-content-quality.md)

# MediaConnect flow state change event
Flow state change event

This event is published when a flow's state has changed from or to any of the following states: Standby, Active, Updating, Deleting, Starting, Stopping, or Error. 

For information about subscribing to this event, see [Amazon EventBridge](https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-what-is.html).

The following message is an example of this event.

```
{
    "account": "111122223333",
    "detail": {
        "currentStatus": "STARTING",
        "previousStatus": "STANDBY"
    },
    "detail-type": "MediaConnect Flow Status Change",
    "id": "01234567-0123-0123-0123-0123456789ab",
    "region": "us-east-1",
    "resources": ["arn:aws:mediaconnect:us-east-1:111122223333:flow:1-23aBC45dEF67hiJ8-12AbC34DE5fG:AwardsShow"],
    "source": "aws.mediaconnect",
    "time": "2022-01-06T00:45:47Z",
    "version": "0"
}
```

# MediaConnect flow maintenance event
Flow maintenance eventMaintenance EventBridge event

The user guide has been updated to include a new EventBridge event for MediaConnect maintenance.

This event is published when a flow's maintenance status has changed, either to or from any of the following states: 
+ **SCHEDULED** - Maintenance is scheduled for the flow.
+ **RESCHEDULED** - MediaConnect is unable to perform maintenance at the previously scheduled date and time. A new date and time has been automatically assigned by MediaConnect for this flow's maintenance.
+ **CANCELED** - Maintenance for this flow is cancelled by MediaConnect.
+ **INPROGRESS** - Maintenance has started and is currently in progress for this flow.
+ **FINISHED** - Maintenance completed successfully for this flow.
+ **FAILED** - Maintenance did not complete successfully for this flow. 

 

For information about subscribing to this event, see [Amazon EventBridge](https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-what-is.html). 

For information about MediaConnect maintenance, see [MediaConnect flow maintenance](https://docs.aws.amazon.com/mediaconnect/latest/ug/maintenance.html).

The following message is an example of this EventBridge event.

```
{
    "version": "0",
    "id": "01234567-0123-0123-0123-0123456789ab",
    "detail-type": "MediaConnect Flow Maintenance",
    "source": "aws.mediaconnect",
    "account": "111122223333",
    "time": "2022-02-14T00:45:47Z",
    "region": "us-east-1",
    "resources": [
        "arn:aws:mediaconnect:us-east-1:111122223333:flow:1-23aBC45dEF67hiJ8-12AbC34DE5fG:ExampleFlow"
    ],
    "detail": {
        "currentStatus": "FINISHED"
    }
}
```

# MediaConnect flow health event
Flow health event

AWS Elemental MediaConnect publishes flow health events after a flow health indicator state changes.

MediaConnect publishes this event any time there is a state change to one or more of the following flow health indicators. This event publishes the current and previous state of the flow.

The following are flow health indicators:
+ **Source state**
  + Possible states: `connected`, `receiving`, `disconnected`, `idle`
+ **Failover switch**
  + Possible states: `true`, `false`
+ **TR-101**: TR-101 is an industry standard technical recommendation for the monitoring of transport streams (TS). The following events are only published for TS based protocols. 
  + **TS sync loss** is `true` when source payloads do not look like a valid transport stream.
  + **Continuity count error** is `true` when the source finds continuity count errors.
  + **Transport error** is `true` when the TS has the transport indicator set.
  + **PCR error** is `true` when there is a PCR discontinuity or a long gap in PCR packet reception.

For information about subscribing to this event, see [Amazon EventBridge](https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-what-is.html).

The following message is an example of this event.

```
{
  "version": "0",
  "id": "01234567-0123-0123-0123-0123456789ab",
  "detail-type": "MediaConnect Flow Health",
  "source": "aws.mediaconnect",
  "account": "012345678901",
  "time": "2006-01-02T15:04:05Z",
  "region": "us-east-1",
  "resources": [
    "arn:aws:mediaconnect:us-east-1:012345678901:flow:1-AbCdEfGhIjKlMnOp-abcdef123455:ExampleFlow"
  ],
  "detail": {
    "unhealthy": true,
    "current": {
      "failover_switch": false,
      "source_state": "CONNECTED",
      "tr101": {
        "ts_sync_loss": false,
        "continuity_count_error": true,
        "transport_error": true,
        "pcr_error": true
      }
    },
    "previous": {
      "failover_switch": false,
      "source_state": "CONNECTED",
      "tr101": {
        "ts_sync_loss": false,
        "continuity_count_error": false,
        "transport_error": false,
        "pcr_error": false
      }
    }
  }
}
```

# MediaConnect alert event
Alert event

 MediaConnect publishes an alert event when a resource encounters an error. The event contains an error code and a message that describes the issue. These alerts are visible on the MediaConnect console, or by using the `describe-flow` AWS Command Line Interface (AWS CLI) command. For more information about the `describe-flow` command, see [AWS CLI Command Reference](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/mediaconnect/describe-flow.html).

For information about subscribing to this event, see [Amazon EventBridge](https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-what-is.html).

The following message is an example of this event.

```
{
 "version": "0",
 "id": "01234567-0123-0123-0123-0123456789ab",
 "detail-type": "MediaConnect Alert",
 "source": "aws.mediaconnect",
 "account": "111122223333",
 "time": "2022-01-06T00:45:47Z",
 "region": "us-east-1",
 "resources": [
 "arn:aws:mediaconnect:us-east-1:111122223333:flow:1-AbCdEfGhIjKlMnOp-abcdef123455:ExampleFlow"
 ],
 "detail": {
 "errored": true,
 "error-code": "AccessDeniedException",
 "error-message": "Permission denied accessing encryption key for output Test. Removing output until it is fixed (secret arn:aws:secretsmanager:us-east-1:111122223333:secret:ExampleSecret, role arn:aws:iam::111122223333:role/ExampleKey)"
 }
}
```

# MediaConnect source health event
Source health event

AWS Elemental MediaConnect publishes source health events after a source health indicator state changes.

MediaConnect publishes this event any time there is a state change to one or more of the following source health indicators. This event publishes the current and previous state of the flow. Note that the source health event lists the affected flow and source in the `resources` section.

The following are source health indicators:
+ **Source state**
  + Possible states: `connected`, `receiving`, `disconnected`, `idle`
+ **TR-101**: TR-101 is an industry standard technical recommendation for the monitoring of transport streams (TS). The following events are only published for TS based protocols. 
  + **TS sync loss** - true when source payloads do not look like a valid transport stream.
  + **Continuity count error** - true when the source finds continuity count errors.
  + **Transport error** - true when the TS has the transport indicator set.
  + **PCR error** - true when there is a PCR discontinuity or a long gap in PCR packet reception.

For information about subscribing to this event, see [Amazon EventBridge](https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-what-is.html).

The following message is an example of this event.

```
{
  "version": "0",
  "id": "01234567-0123-0123-0123-0123456789ab",
  "detail-type": "MediaConnect Source Health",
  "source": "aws.mediaconnect",
  "account": "012345678901",
  "time": "2006-01-02T15:04:05Z",
  "region": "us-east-1",
  "resources": [
    "arn:aws:mediaconnect:us-east-1:012345678901:flow:1-AbCdEfGhIjKlMnOp-abcdef123455:ExampleFlow",
    "arn:aws:mediaconnect:us-east-1:012345678901:source:1-AbCdEfGhIjKlMnOp-abcdef123455:ExampleSource"
  ],
  "detail": {
    "unhealthy": true,
    "current": {
      "state": "CONNECTED",
      "tr101": {
        "ts_sync_loss": false,
        "continuity_count_error": true,
        "transport_error": true,
        "pcr_error": true
      }
    },
    "previous": {
      "state": "CONNECTED",
      "tr101": {
        "ts_sync_loss": false,
        "continuity_count_error": false,
        "transport_error": false,
        "pcr_error": false
      }
    }
  }
}
```

# MediaConnect output health event
Output health event

AWS Elemental MediaConnect publishes output health events after an output health indicator state changes.

 MediaConnect publishes this event any time there is a state change to one or more of the following output health indicators. This event publishes the current and previous state of the flow. Note that the output health event lists the affected flow and output in the `resources` section.

The following are output health indicators:
+ **Output state**
  + Possible states: `connected`, `sending`, `disconnected`, `idle`

For information about subscribing to this event, see [Amazon EventBridge](https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-what-is.html).

The following message is an example of this event.

```
{
  "version": "0",
  "id": "01234567-0123-0123-0123-0123456789ab",
  "detail-type": "MediaConnect Output Health",
  "source": "aws.mediaconnect",
  "account": "012345678901",
  "time": "2006-01-02T15:04:05Z",
  "region": "us-east-1",
  "resources": [
    "arn:aws:mediaconnect:us-east-1:012345678901:flow:1-AbCdEfGhIjKlMnOp-abcdef123455:ExampleFlow",
    "arn:aws:mediaconnect:us-east-1:012345678901:output:1-AbCdEfGhIjKlMnOp-abcdef123455:ExampleOutput"
  ],
  "detail": {
    "current": {
      "state": "CONNECTED"
    },
    "previous": {
      "state": "DISCONNECTED"
    }
  }
}
```

# MediaConnect flow content quality event
Content quality eventContent quality EventBridge events

A new content quality monitoring EventBridge event has been added to MediaConnect.

AWS Elemental MediaConnect publishes the following event when an issue is detected with content quality: `MediaConnect Flow Content Quality`

MediaConnect publishes this event in three scenarios:

1. When the duration threshold is breached for one of the following metrics:
   + **Black frames**: Periods of black video frames are detected in the stream.
   + **Frozen frames**: Periods of unchanging video frames are detected in the stream.
   + **Silent audio**: Periods of audio silence are detected in the stream.

1. When audio or video content is missing from the stream. This happens when monitoring is configured for audio or video streams, but MediaConnect can’t detect the expected data to monitor.

1. When a previously reported issue has been resolved (clearing state).

MediaConnect publishes these events whenever the state of any monitored condition changes. This includes when issues are first detected, when they clear, or any combination of these changes. For example, a single event might show some issues that are clearing while others are being detected, depending on what changed during that reporting period.

In the event JSON, you'll see the following fields to indicate these issues:

**For duration threshold breaches:**
+ `black_frames_duration_breaching`: true when black frames exceed the threshold
+ `frozen_frames_duration_breaching`: true when frozen frames exceed the threshold
+ `silent_audio_duration_breaching`: true when silent audio exceeds the threshold

**For missing audio/video:**
+ `audio_missing`: true when audio content is missing
+ `video_missing`: true when video content is missing

These alerts are visible on the MediaConnect console, or by using the `describe-flow` AWS Command Line Interface (AWS CLI) command. For more information about the `describe-flow` command, see the [AWS CLI Command Reference](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/mediaconnect/describe-flow.html).

For information about subscribing to this event, see [Amazon EventBridge](https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-what-is.html).

The following message is an example of the `MediaConnect Flow Content Quality` event. In this example, the event indicates both missing audio content and a frozen frames duration threshold breach in the stream.

```
{
    "impacted": true,
    "streams": [
        {
            "audio_missing": true,
        },
        }
            "frozen_frames_duration_breaching": true,
        }
    ]
}
```