Integrate ECS
Integrate Elastic Compute Service (ECS) instances with Cloud Monitor to collect metrics, logs, and events.
Prerequisites
You have created an ECS instance.
You have activated Simple Log Service (SLS).
You have activated Managed Service for Prometheus and Hybrid Cloud Monitoring.
If you use a RAM user, grant the
AliyunCloudMonitorFullAccesssystem policy to it.
Billing
Integrating cloud service metrics incurs fees for real-time data export from Hybrid Cloud Monitoring and Managed Service for Prometheus.
Collecting host metrics (from node-exporter and windows-exporter), process metrics (from process-exporter), and custom metrics from textfiles incurs fees for Managed Service for Prometheus.
Integrating logs and events incurs fees for SLS.
Integration steps
Log on to the Cloud Monitor console. Select a workspace, then click Integration Center > Elastic Compute Service (ECS).
Create or select a policy, set the entity scope, and click Determine.
Select the data to collect and click Determine:
Observability data
Description
Policy name
Optional. Name for this integration.
ECS Monitoring Metrics
Collects metrics for ECS instances.
Notes:
This feature collects agentless metrics for ECS from Cloud Monitor. You can also install exporters, such as Node-Exporter, Process-Exporter, or Windows-Exporter, to collect host agent metrics.
Installing an agent on a host in a production environment is considered a production change. Submit a change request according to your organization's standards.
If cross-region access is enabled, you cannot use an agent to collect node, process, or Windows metrics.
Exporter installation is not currently supported on LifseaOS. Instances that run LifseaOS are skipped automatically.
Resource usage: The agent runs as a systemd service with GOMAXPROCS=1, a CPU limit of 30%, and a memory limit of 256 MB. Resource usage is low under normal conditions. The collection overhead increases with the number of processes on the host.
Risk warning: Enabling the Collect Process PSS Memory Metrics feature reads the smaps file for each process and briefly holds the mmap_lock. This can introduce latency glitches for processes that use large amounts of memory or perform frequent mmap operations. If you do not need Proportional Set Size (PSS) metrics, disable this feature.
Tag Key: Tag key for ECS instances. Tags matching
o11y.aliyun.dev/*are automatically extracted and injected as key-value pairs into Prometheus metrics.Collect Cloud Service Metrics: Collects ECS agent-free metrics from Cloud Monitor.
Collect Node Metrics (Linux): Installs node-exporter on Linux hosts to collect node metrics (agent-based).
Node-Exporter Service Port: Port used by node-exporter.
Collect TextFile: Collects Prometheus-formatted metrics from a specified file.
Collect Process Metrics (Linux): Installs process-exporter on Linux hosts to collect process metrics (agent-based).
Process-Exporter Service Port: Port used by process-exporter.
Collect Process PSS Memory Metrics: When enabled, reads each process's smaps file to collect PSS (Proportional Set Size) and other memory metrics.
Collect Windows Metrics (Windows): Installs windows-exporter on Windows hosts to collect node metrics (agent-based).
Windows Service Port: Port used by windows-exporter.
Automatically Configure Security Group: Automatically adds a security group rule if existing rules block the integration.
Metric Collection Interval (seconds): Collection interval in seconds. Default: 30.
Alibaba Cloud ECS Audit Logs
Collects audit logs from the host.
Enable System Log Collection: Enables system log collection from the host.
System Log Logstore Name: Logstore name. Default: acs-ecs-system (modifiable). The associated project is auto-created as
ws-<WorkspaceName>.Data Retention Period: Days to retain data. Valid values: 1 to 3650 (3650 = permanent). Logs are deleted after expiry.
Shard Count: Each shard supports 5 MB/s write and 10 MB/s read. Split shards when traffic exceeds capacity; merge shards when traffic is low to reduce costs.
Alibaba Cloud ECS Runtime Security Logs
Collects runtime logs using eBPF to capture file access and process activities. Does not support multiple collection configurations.
Enable Host Runtime Log Collection: Enables runtime log collection.
Collect Runtime - Process: Enables process runtime log collection.
Collect Runtime - File: Enables file access runtime log collection.
Runtime Log Logstore Name: Logstore name. Default: acs-ecs-runtime (modifiable). The associated project is auto-created as
ws-<WorkspaceName>.Data Retention Period: Days to retain data. Valid values: 1 to 3650 (3650 = permanent). Logs are deleted after expiry.
Shard Count: Each shard supports 5 MB/s write and 10 MB/s read. Split shards when traffic exceeds capacity; merge shards when traffic is low to reduce costs.
Alibaba Cloud ECS Event
Integrates ECS system events.
Enable ECS System Events: Enables ECS system event integration. When enabled, events appear on the CloudLens for ECS page. Otherwise, this page displays no data.
After the integration is complete, in the left-side navigation pane, click Entity Explorer, find the target ECS instance in All Entities, then click the instance ID to view its dashboard.
Built-in dashboards: Click CloudLens to view built-in dashboards.
Port security
Cloud Monitor uses the same VPC as the target ECS instance, selects a vSwitch to attach, and initiates collection requests to the target host port. Collection does not depend on public network access, so an ECS instance needs no Internet exposure to be monitored. Each exporter listens on the internal address of the ECS server and publishes no endpoint that is reachable from the Internet.
Only agent metrics reach Cloud Monitor through a port on the instance. Agentless Alibaba Cloud service metrics for ECS are reported through the real-time data export path of Hybrid Cloud Monitoring, so they need no inbound rule. Host, process, and Windows metrics are agent metrics: an exporter runs on the server, and Cloud Monitor reads it over the following default collection ports. Each port corresponds to one service port configuration item in the Integration steps section.
Exporter | Default port |
node-exporter |
|
process-exporter |
|
windows-exporter |
|
Do not open these ports to 0.0.0.0/0 in an inbound security group rule. Such a rule grants public network access to your monitoring data and creates the Internet exposure that collection never needs. Allow the 100.64.0.0/10 CIDR block only.
If you select Automatically Configure Security Group during integration, Cloud Monitor runs a security group check against the target instance and adds the internal network inbound security group rules when the check does not pass. You then do not need to add any rule manually.
Installing an exporter on a host in a production environment is a production change. Before you enable agent collection on such a host, review the inbound rules of the target security group and confirm that no rule exposes the collection ports beyond 100.64.0.0/10.
To change a service port or to turn automatic security group configuration on or off after integration, edit the integration policy for ECS. Log on to the Cloud Monitor console, select the workspace that holds the integration, then click Integration Center in the left-side navigation pane.
FAQ
Why do no ECS entities or metrics appear in the console after the integration is complete?
Cause: The data storage region of the integration policy differs from the region of the current workspace. When observability data is stored in a region other than the workspace region, the data does not surface in the current workspace, so neither the entities nor their dashboards appear.
Solution: Check the data storage region configured on the integration policy against the region of the workspace that you are viewing, make the two regions match, then refresh the page.
Why is no agent metric data from Node-Exporter, Process-Exporter, or Windows-Exporter reported?
Cause: The security group of the target ECS instance does not allow access to the collection ports that the agent uses.
Solution: In the integration policy's Agent Management section, find the agent associated with the VPC of the target ECS instance and check the vSwitch used by the agent. Then configure an inbound rule in the target instance's security group to allow the vSwitch CIDR block used by the managed agent.
Data storage policies
After integration, CloudMonitor creates SLS logstores and a Prometheus instance to store observability data.
Type | Default storage location | Notes |
Events | Project: logstore: | None |
Metrics | Prometheus instance: | None |
Logs |
| None |
Manage integration policies
To modify or delete an integration policy, go to the Integration Center and find the target policy, then click Edit or Delete.
Deleting an integration policy for ECS, an Alibaba Cloud service, does not automatically uninstall installed agents. Before you delete an ECS environment, uninstall the agents in that environment. The console prevents you from deleting an environment while agents remain installed.
On the Provisioning page, find the target ECS environment, open Agent Settings, and click Uninstall to uninstall its agents.
To uninstall agents in batches, call the DeleteAddonRelease API.