---
Title: Configure triggers
URL Source: https://company-skill.com/p/ess/ess-configure-triggers
Language: en
Description: You want to define when and how your Auto Scaling group adds or removes ECS instances—either at fixed times (scheduled), in response to system metrics like CPU (event-triggered), or based on custom…
---

# Configure triggers

Part of **Auto Scaling (ESS)**. Route queries via `POST https://company-skill.com/api/route`.

## What You Want to Do

You want to define when and how your Auto Scaling group adds or removes ECS instances—either at fixed times (scheduled), in response to system metrics like CPU (event-triggered), or based on custom business metrics like request queue depth.

- Can I trigger scaling based on custom metrics?

## Decision Tree

Pick the best path for your situation:

- **If** your scaling logic uses standard system metrics like **(ECS) CPU Utilization** and you prefer a **graphical console interface** → Use (go to *ess/ess-instance*)
- **If** you need to **dynamically manage rules via code**, integrate with monitoring systems, or manage **ApsaraDB RDS instances** alongside scaling groups → Use API (go to *ess/ess-instance*)
- **If** your trigger depends on **custom business metrics** (e.g., order count, job queue length) that require **CloudMonitor Java SDK** integration → Use (go to *ess/ess-monitoring*)
- **Otherwise (default)** → Start with the **console path** if you're new to Auto Scaling or only use built-in metrics—it’s the simplest way to create **Create Scaling Rule**, **Create Scheduled Task**, and **Create Event-Triggered Task** without coding.

## Path Comparison

| Path | Best For | Complexity | Code Required | Automation | Key Fact | Detail Skill |
|------|----------|------------|---------------|------------|----------|-------------|
| Console / Dashboard | low | No | No | Only supports system monitoring metrics like CPU; no custom metrics | `ess/guide/ess-instance` |
| API | medium | Yes | Yes | Supports **AttachDBInstances** and **DetachDBInstances** with **ForceAttach parameter** for RDS integration | `ess/api/ess-instance` |
| Console / Dashboard | high | Yes | Yes | Requires **Java SDK** and incurs cost: ¥0.001 per custom metric data point after 1000 free/month | `ess/guide/ess-monitoring` |

## Path Details

### Path 1: Console / Dashboard
**Brief Description**: Use the Alibaba Cloud Console to interactively create **Create Scaling Rule**, **Create Scheduled Task**, and **Create Event-Triggered Task**. You select **Rule Type** (e.g., scale out/in), define **Operation** (add/remove instances), choose **Monitoring Metrics** like CPU, and associate them with a **Scaling Group**. All actions are UI-driven with no code.

**Key technical facts**:
- Billing: Auto ScalingECS

### Path 2: API

**Brief Description**: Programmatically manage **Event-Triggered Tasks** and scaling rules using **API operations** such as **AttachDBInstances** and **DetachDBInstances**. This path supports associating **ApsaraDB RDS instances** with **scaling groups**, requiring management of the **private IP address whitelist** and use of the **ForceAttach parameter** for forced attachment.

**Key technical facts**:
- Billing: Auto ScalingECS

**When to Use**:
- ApsaraDB RDS

### Path 3: Console / Dashboard
**Brief Description**: Use the **CloudMonitor Java SDK** to report **Custom Metrics** (e.g., request latency, queue depth) into **Application Groups**. These metrics can then drive an **event-triggered task** in Auto Scaling. Requires credentials (**accAutoScalingKey** and **accAutoScalingSecret**) and handles **metric aggregation** before triggering.

**Key technical facts**:
- Billing: 0.001/1000

**When to Use**:
- JavaCloudMonitor SDK

- JavaCloudMonitor SDK
- 1-2

## FAQ

Q: Which path should I start with?
A: If you’re using standard metrics like CPU and don’t need code, start with the **console path**. It lets you quickly create **Create Scaling Rule** and **Scheduled Tasks** without programming.

Q: What if I need to scale based on RabbitMQ queue length but used the console path?
A: You’ll hit a hard limitation: the console **only supports system monitoring metrics** like CPU and cannot use **Custom Metrics**. You must switch to the **CloudMonitor Java SDK** path.

Q: What if I chose the API path but my app isn’t in Java and I need custom metrics?
A: You’ll be unable to report custom metrics—the **ess-monitoring** path **only supports Java SDK** for **Custom Metrics** ingestion. Non-Java apps can’t use this method per current documentation.

Q: Can I use the API path to manage scheduled scaling?
A: The API path focuses on **Event-Triggered Tasks** and **ApsaraDB RDS instances** via **AttachDBInstances**; scheduled tasks are primarily a console feature. For full scheduled+event coverage with code, combine API calls with external schedulers.

Q: Is there a cost for using custom metrics?
A: Yes—after 1000 free data points/month, **CloudMonitor** charges ¥0.001 per point. Standard system metrics (used in console/API paths) incur no extra cost beyond ECS billing.

Q: Why does the API path mention RDS instances?
A: Because **AttachDBInstances** and **DetachDBInstances** let you automatically add/remove RDS read-only instances to your **scaling groups**, managing the **private IP address whitelist** during scale events—useful for database-coupled apps.

## Related queries

configure scaling triggers, set up auto scaling rules, create scheduled scaling task, event-based scaling, CPU-based scaling, custom metric scaling, how to trigger scaling, where to set scaling rules, modify scaling rules, difference between scheduled and event scaling, auto scale by queue length, s

---
Part of [Auto Scaling (ESS)](https://company-skill.com/p/ess.md) · https://company-skill.com/llms.txt
