Skip to content

AWS ECS

Amazon ECS features are integrated with the Amazon Web Services Fargate serverless computing engine, using Guance to monitor the service runtime.

Configuration

Install Func

It is recommended to enable the Guance integration - extension - managed Func: all prerequisites are automatically installed. Please continue with the script installation.

If you deploy Func on your own, refer to Self-deployed Func

Enable Script

Note: Please prepare an Alibaba Cloud AK that meets the requirements in advance (for simplicity, you can directly grant global read-only permission ReadOnlyAccess).

Managed Version Enable Script

  1. Log in to the Guance console.
  2. Click the 【Integration】 menu and select 【Cloud Account Management】.
  3. Click 【Add Cloud Account】, choose 【AWS】, and fill in the required information on the interface. If the cloud account information has been configured before, skip this step.
  4. Click 【Test】, after the test succeeds, click 【Save】. If the test fails, check whether the relevant configuration information is correct and retest.
  5. In the 【Cloud Account Management】 list, you can see the added cloud account. Click the corresponding cloud account to enter the details page.
  6. Click the 【Integration】 button on the cloud account details page. In the Not Installed list, find AWS ECS, click the 【Install】 button, and a pop-up installation interface will appear for installation.

Manual Enable Script

  1. Log in to the Func console, click 【Script Market】, enter the official script market, and search for guance_aws_ecs.

  2. After clicking 【Install】, input the corresponding parameters: AWS AK ID, AK Secret, and account name.

  3. Click 【Deploy Startup Script】, the system will automatically create a Startup script set and automatically configure the corresponding startup script.

  4. After enabling, you can see the corresponding automatic trigger configuration in 「Management / Automatic Trigger Configuration」. Click 【Execute】 to run it immediately without waiting for the scheduled time. Wait a moment, and you can view the execution task records and corresponding logs.

Verification

  1. Confirm in 「Management / Automatic Trigger Configuration」 whether the corresponding task has the corresponding automatic trigger configuration. You can also view the corresponding task records and logs to check for any abnormalities.
  2. In Guance, 「Infrastructure / Custom」, check if there is asset information.
  3. In Guance, 「Metrics」, check if there are corresponding monitoring data.

Metrics

After configuring Amazon CloudWatch, the default metric sets are as follows. More metrics can be collected through configuration. Amazon CloudWatch Metric Details

Instance Metrics

AWS/ECS related metrics.

Metric Description
CPUUtilization The service CPU utilization rate (a metric filtered by ClusterName and ServiceName) is calculated by dividing the total number of CPU units used by tasks belonging to the service by the total number of CPU units reserved for tasks belonging to the service. This service CPU utilization metric applies to tasks using the Fargate and EC2 launch types. Unit: Percentage
MemoryUtilization The service memory utilization rate (a metric filtered by ClusterName and ServiceName) is calculated by dividing the total amount of memory used by tasks belonging to the service by the total amount of memory reserved for tasks belonging to the service. This service memory utilization metric applies to tasks using the Fargate and EC2 launch types. Unit: Percentage

Objects

The collected AWS ECS object data structure can be viewed in 「Infrastructure - Custom」.

{
  "measurement": "aws_ecs",
  "tags": {
      "RegionId": "cn-northwest-1",
      "clusterArn": "arn:aws-cn:***",
      "clusterName": "Harry_NodeJs",
      "name": "Harry_NodeJs",
      "status": "ACTIVE"
  },
  "fields": {
    "activeServicesCount": 1,
    "configuration": "{}",
    "message"            : "{Instance JSON Data}",
    "pendingTasksCount": 0,
    "registeredContainerInstancesCount": 0,
    "runningTasksCount": 1,
    "statistics": "[]"
  }
}

Note: Fields in tags and fields may change with subsequent updates.

Feedback

Is this page helpful? ×