AWS Elemental MediaPackage
AWS Elemental MediaPackage prepares live and on-demand video for playback devices, in adaptive bitrate formats.
MediaPackage exports access logs and metrics to CloudWatch. These steps send them to Hydrolix through three Amazon Data Firehose streams: one for ingress access logs, one for egress access logs, and one for metrics. Adding MediaPackage as a data source in the Hydrolix web console creates all three streams, and the default MediaPackage dashboard uses data from each.
Prerequisites⚓︎
- Three Amazon Data Firehose streams, for ingress logs, egress logs, and metrics, such as
hdx-logs-mediapackage-ingress,hdx-logs-mediapackage-egress, andhdx-logs-mediapackage-metrics:- With Hydrolix for AWS: adding MediaPackage as a data source provisions all three.
- On a self-managed cluster: create the streams and connect them to Hydrolix. See Amazon Data Firehose.
Send MediaPackage access logs to Hydrolix⚓︎
MediaPackage writes ingress and egress access logs to separate CloudWatch log groups. A subscription filter on each log group forwards its logs to the matching Firehose stream.
- Enable access logging. Follow Access logging.
- Create an IAM role that lets CloudWatch Logs write to the Firehose stream. For the CLI, follow the steps that create the CloudWatch Logs role in Subscription filters with Amazon Data Firehose. For the console, see Creating a role for an AWS service (console).
- In the CloudWatch console, open Log groups under Logs.
- Select the log group for ingress access logs:
/aws/MediaPackage/IngressAccessLogsby default, or the custom name chosen when enabling access logging. - From the Actions menu, choose Subscription filters > Create Amazon Data Firehose subscription filter.
- Choose the Data Firehose stream for ingress logs. With Hydrolix for AWS, the stream name begins with
hdx-logs-mediapackage-ingress.... - In Grant permissions, select the IAM role created earlier.
- In Log format, choose JSON.
- Select Start streaming.
- Repeat the subscription steps, starting at Log groups, for egress logs with these values:
- Log group:
/aws/MediaPackage/EgressAccessLogsby default, or the custom name chosen when enabling access logging - Data Firehose stream: the one for egress logs. With Hydrolix for AWS, its name begins with
hdx-logs-mediapackage-egress...
- Log group:
When both subscriptions are active, ingress and egress access logs stream to Hydrolix.
Limit log retention to reduce costs
To reduce CloudWatch storage costs, lower the retention period for these log groups if nothing reads the logs in CloudWatch. To change it, see Change log data retention in CloudWatch Logs.
Send MediaPackage metrics to Hydrolix⚓︎
MediaPackage publishes metrics to CloudWatch. To send them to Hydrolix:
- In the CloudWatch console, open Streams under Metrics.
- Select Create metric stream.
- On the setup page, choose Custom setup with Firehose.
- Set the destination to the Data Firehose stream for metrics. With Hydrolix for AWS, the stream name begins with
hdx-logs-mediapackage-metrics.... - In Change output format (optional), select JSON.
- (Optional) Overwrite the default name with a Custom metric stream name.
- Select Create metric stream. Metrics then flow from CloudWatch to Hydrolix.
Cross-region data transfer costs⚓︎
To reduce AWS charges for data transfer between regions, run MediaPackage, the Firehose streams, and the Hydrolix cluster in the same region. These charges appear on the AWS bill and aren't part of the Hydrolix subscription.
To find the cluster's region, see the Product Info page of the Hydrolix web console. To estimate costs, use the AWS pricing calculator and Amazon Data Firehose pricing.
Remove the data source⚓︎
To remove the Firehose streams that Hydrolix provisioned, select de-activate in the Hydrolix web console.