Skip to main content

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.

ParameterRequiredDescription
auth_modeYesAuthentication 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_idYesAWS Access Key ID.
secret_access_keyYesAWS Secret Access Key.
role_arnRequired in assume_role modeIAM role ARN to assume, for example arn:aws:iam::123456789012:role/ONEEC2MonitoringRole.
external_idNoExternal ID used by AssumeRole. If configured, it must match the value in the target role trust policy.
partitionNoAWS partition. Valid values are aws, aws-cn, and aws-us-gov. The default is aws.
regionsNoRegions to collect, for example [ap-southeast-1, us-east-1]. If left as [], available Regions in the selected partition are discovered automatically.
metricsNoAWS raw metric names to collect, for example [CPUUtilization, NetworkIn, StatusCheckFailed]. If left as [], all applicable EC2 metrics are collected. Names are case-sensitive.
interval_secondsNoCollection interval. Valid range: 60 to 3600 seconds. Default: 300 seconds.
timeout_secondsNoTimeout for each AWS API request and reporting request. Valid range: 1 to 30 seconds. Default: 5 seconds.
retry_countNoExtra 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:

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, CPUUtilization maps to aws_ec2_cpu_utilization.
  • Metrics include tags such as region, instance_id, aws_namespace, aws_metric_name, and statistic by 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, and aws_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.