AWS EC2 Metrics Integration
Use the AWS API to ingest Amazon EC2 CloudWatch metric data. The collector automatically discovers non-terminated EC2 instances in the specified Regions, collects metrics from the AWS/EC2 namespace, and processes the data into ONE platform standard metrics.
Prerequisites
- SmartGate has been deployed, and SmartGate can communicate with the ONE platform.
- The ONE platform account has Data Integration Management permission and available data ingestion License entitlement.
- An IAM user or IAM role has been created in the AWS account for collection and granted the required read-only permissions.
- The target EC2 instances can report monitoring metrics to CloudWatch normally.
Getting Started
ONE Platform Setup
Navigate to Data Framework -> Integrations -> Custom Integrations, find the AWS EC2 data integration card, and click Create Integration.
Select the SmartGate that runs the collection task and fill in the integration parameters according to your environment.
| Parameter | Required | Description |
|---|---|---|
auth_mode | Yes | Authentication mode. static directly uses access keys. assume_role uses base credentials to call AWS STS and obtain temporary credentials for the target role. |
access_key_id | Yes | AWS Access Key ID. |
secret_access_key | Yes | AWS Secret Access Key. |
role_arn | Required in assume_role mode | IAM role ARN to assume, for example arn:aws:iam::123456789012:role/ONEEC2MonitoringRole. |
external_id | No | External ID used by AssumeRole. If configured, it must match the value in the target role trust policy. |
partition | No | AWS partition. Valid values are aws, aws-cn, and aws-us-gov. The default is aws. |
regions | No | Regions to collect, for example [ap-southeast-1, us-east-1]. If left as [], available Regions in the selected partition are discovered automatically. |
metrics | No | AWS raw metric names to collect, for example [CPUUtilization, NetworkIn, StatusCheckFailed]. If left as [], all applicable EC2 metrics are collected. Names are case-sensitive. |
interval_seconds | No | Collection interval. Valid range: 60 to 3600 seconds. Default: 300 seconds. |
timeout_seconds | No | Timeout for each AWS API request and reporting request. Valid range: 1 to 30 seconds. Default: 5 seconds. |
retry_count | No | Extra retry attempts after a failed request. Valid range: 0 to 5. Default: 2. |
Save the task after filling in the parameters. If the task is created in a disabled state, enable it manually.
AWS Platform Setup
Create a dedicated IAM identity for the collection task in AWS and grant at least the following API permissions:
sts:GetCallerIdentity, ec2:DescribeInstances, cloudwatch:ListMetrics, and cloudwatch:GetMetricData. If regions is configured as [], also grant ec2:DescribeRegions.
Refer to the AWS official documentation for configuration details:
- IAM permission policy: Creating IAM policies
- Access key authentication: Managing access keys for IAM users
- AssumeRole authentication: Creating a role for an IAM user
- AssumeRole API and External ID: AWS STS AssumeRole
- EC2 CloudWatch monitoring: Monitor your EC2 instances using CloudWatch
After completing the AWS-side configuration, enter the authentication information and target Regions in the ONE platform AWS EC2 integration task.
Configure Data Flow
- ONE provides an out-of-the-box default data processing flow that converts collected CloudWatch data into standard metrics.
- Standard metric names start with
aws_ec2_. For example,CPUUtilizationmaps toaws_ec2_cpu_utilization. - Metrics include tags such as
region,instance_id,aws_namespace,aws_metric_name, andstatisticby default. - You can also adjust the data flow manually for your monitoring scenario. If you use the EC2 alert template, keep the metric names and key tags such as
region,instance_id, andaws_namespace, otherwise alert rules may fail to match the data.
Verification
- Wait for at least one collection interval after first startup. EC2 basic monitoring metrics are usually generated at 5-minute granularity, while detailed monitoring and status check metrics can provide finer-grained data.
- Query metrics prefixed with
aws_ec2_in Data Framework -> Data Model -> Metrics, or in Insight -> Data Explorer.