Manage integrations

Updated at:

The Cloud Monitor Integration Center CLI aliyun cms2 manages monitoring data ingestion for applications deployed in Conatiner Service for Kubernetes (ACK), Elastic Compute Service (ECS), and other cloud services. The management is built around integration policies and add-on releases: you create an integration policy first, then deploy one or more add-ons under the policy.

Subcommand overview

Subcommand

Description

integration addon

Query the add-on catalog (metadata, parameter schema, and code templates). This is the first step before integration.

integration policy

Manage integration policies (create, query, update, delete, and list).

integration addon-release

Manage add-on releases under a policy (deploy, query, update, and delete).

integration collector / custom-job / service-monitor / pod-monitor / job-target

Query collectors, custom collection jobs, and collection targets. Run with --help for usage.

integration dashboard / storage / resource

Query dashboards, storage requirements, and resources associated with an integration policy. Run with --help for usage.

integration check-collector-target

Pre-check collection target connectivity and metric analysis. Run with --help for usage.

integration check-scrape-config

Dry-run a deployed scrape configuration (service discovery and relabel verification). Run with --help for usage.

Prerequisites

  • The CLI tool is installed and configured.

  • You have an AccessKey for the target Alibaba Cloud account with the AliyunCloudMonitorFullAccess permission granted.

  • A workspace is created. The workspace name is typically in the format default-cms-{userId}-{regionId}.

Typical workflow

# 1. Discover available addons and view the parameter schema and integration guide
aliyun cms2 integration addon list --search ack
aliyun cms2 integration addon --addon-name cloud-acs-ack

# 2. Create an integration policy
aliyun cms2 integration policy create --body '{
  "policyType": "CS",
  "policyName": "my-ack-policy",
  "workspace": "default-cms-12345-cn-hangzhou",
  "entityGroup": {
    "clusterEntityType": "acs.ack.cluster",
    "clusterId": "c1234567890abcdef"
  }
}'
# The response returns a policyId, such as ip-abc123

# 3. Deploy an addon under the policy
aliyun cms2 integration addon-release create --policy-id ip-abc123 --body '{
  "addonName": "cloud-acs-ack",
  "version": "*",
  "envType": "CS",
  "workspace": "default-cms-12345-cn-hangzhou",
  "values": "{\"clusterId\":\"c1234567890abcdef\"}"
}'

# 4. Verify the deployment
aliyun cms2 integration addon-release list --policy-id ip-abc123

Add-on catalog

The add-on catalog lets you discover available add-ons and their parameter schemas before integration. Before you integrate a cloud service, run integration addon to view the add-on's policyType, envType, and values parameter schema.

integration addon — View add-on details

When you specify --addon-name, the integration addon command outputs the add-on metadata, parameter schema, and integration guide. If one of the underlying API calls fails, the command still returns partial results.

# View the complete addon information (metadata + schema + integration guide)
aliyun cms2 integration addon --addon-name cloud-acs-ack

# Specify the environment type
aliyun cms2 integration addon --addon-name cloud-acs-ack --env-type CS

Parameter

Type

Description

--addon-name

string

Add-on name. When specified, the command displays details and the integration guide.

--env-type

string

Environment type (CS, ECS, or Cloud).

--version

string

Add-on version. Default: latest.

--aliyun-lang

string

Language (zh or en). Default: zh.

integration addon list — List add-ons

# List all addons
aliyun cms2 integration addon list

# Filter by category
aliyun cms2 integration addon list --category database

# Search by keyword
aliyun cms2 integration addon list --search ack

# Filter by entity type (OR semantics, comma-separated)
aliyun cms2 integration addon list --entity-type acs.ecs.instance,acs.rds.instance

Parameter

Type

Description

--category

string

Filter by category, such as database.

--search

string

Filter by keyword.

--entity-type

string

Filter by entity type (comma-separated, OR semantics).

--aliyun-lang

string

Language (zh or en). Default: zh.

integration addon get — Get add-on details

The integration addon get command combines the GetAddon, GetAddonSchema, and GetAddonCodeTemplate APIs and returns the add-on metadata, parameter schema, and code template. If any API call fails, the command fails immediately. For fault-tolerant discovery, use integration addon --addon-name instead.

aliyun cms2 integration addon get --addon-name cloud-acs-ack --env-type CS

Parameter

Type

Description

--addon-name

string

Add-on name. Required.

--env-type

string

Environment type (CS, ECS, or Cloud).

--version

string

Add-on version. Default: latest.

--aliyun-lang

string

Language (zh or en). Default: zh.

Integration policies

The integration policy subcommand manages the lifecycle of integration policies, including creation, query, update, deletion, and listing.

integration policy create — Create a policy

# Create a policy for cloud service integration
aliyun cms2 integration policy create --body '{
  "policyType": "Cloud",
  "policyName": "my-rds-policy",
  "workspace": "default-cms-12345-cn-hangzhou"
}'

# Create a policy for ACK integration
aliyun cms2 integration policy create --body '{
  "policyType": "CS",
  "policyName": "my-ack-policy",
  "workspace": "default-cms-12345-cn-hangzhou",
  "entityGroup": {
    "clusterEntityType": "acs.ack.cluster",
    "clusterId": "c1234567890abcdef"
  }
}'

# Create a policy from a JSON file
aliyun cms2 integration policy create --body @./policy.json

Parameter

Type

Description

--body

string

Request body as inline JSON or @file.json. Required.

--show-example-body

bool

Print an example request body and exit.

--show-schema

bool

Print the JSON schema of the request body and exit.

Required body fields

Field

Description

policyType

Policy type, such as CS, ECS, or Cloud. Determined by the add-on catalog.

policyName

Policy name. Must not be empty.

workspace

Workspace name.

For container scenarios (policyType=CS), entityGroup.clusterEntityType (acs.ack.cluster) and entityGroup.clusterId (ACK cluster ID) are also required. For cross-account scenarios, specify the UID of the account that owns the target instance in entityGroup.entityUserId. The response returns the generated policyId.

integration policy get — Query a policy

aliyun cms2 integration policy get --policy-id ip-abc123def456

Parameter

Type

Description

--policy-id

string

Integration policy ID. Required.

integration policy update — Update a policy

Only the fields included in the body are modified. Common uses include renaming the policy, changing feePackage, or updating resourceGroupId or tags.

aliyun cms2 integration policy update --policy-id ip-abc123def456 --body '{
  "policyName": "new-policy-name",
  "feePackage": "CS_Pro",
  "resourceGroupId": "rg-aekzoiafjtr7zyq",
  "tags": [{"key": "env", "value": "production"}]
}'

Parameter

Type

Description

--policy-id

string

Integration policy ID. Required.

--body

string

Request body as inline JSON or @file.json. Required.

integration policy delete — Delete a policy

Deleting a policy triggers a cascade delete of all add-on releases under it. You do not need to delete add-on releases separately beforehand.

Warning

This operation is irreversible.

aliyun cms2 integration policy delete --policy-id ip-abc123def456

Parameter

Type

Description

--policy-id

string

Integration policy ID. Required.

integration policy list — List policies

# List all policies
aliyun cms2 integration policy list

# Filter by type
aliyun cms2 integration policy list --policy-type CS

# Filter by workspace and region
aliyun cms2 integration policy list --workspace default-cms-12345-cn-hangzhou \
  --filter-region-ids cn-hangzhou,cn-shanghai

# Search by keyword
aliyun cms2 integration policy list --query my-policy

# Paged query
aliyun cms2 integration policy list --max-results 10 --next-token "eyJ..."

Parameter

Type

Description

--policy-type

string

Filter by policy type (CS, ECS, Cloud, etc.).

--policy-id

string

Filter by policy ID.

--policy-name

string

Filter by policy name.

--workspace

string

Filter by workspace.

--filter-region-ids

string

Filter by region ID (comma-separated).

--prometheus-id

string

Filter by Prometheus instance ID.

--bind-resource-id

string

Filter by bound resource ID.

--entity-group-ids

string

Filter by entity group ID (comma-separated).

--resource-group-id

string

Filter by resource group.

--addon-name

string

Filter by add-on name.

--query

string

Filter by keyword.

--tag

string

Filter by tag (JSON array, such as '[{"key":"env","value":"prod"}]').

--max-results

int32

Maximum number of results to return. Default: 30. Maximum: 100.

--next-token

string

Pagination token.

Add-on releases

An add-on release represents a deployed monitoring add-on that contains the add-on name, version, parameter values (values, an escaped JSON string), and environment type. All subcommands require --policy-id to specify the parent integration policy.

integration addon-release create — Deploy an add-on

# Deploy a CS addon (values carry cluster parameters)
aliyun cms2 integration addon-release create --policy-id ip-abc123 --body '{
  "addonName": "cloud-acs-ack", "version": "*", "envType": "CS",
  "workspace": "default-cms-12345-cn-hangzhou",
  "values": "{\"clusterId\":\"c123\",\"clusterName\":\"my-cluster\"}"
}'

# Deploy a cloud addon with entity type and region filtering
aliyun cms2 integration addon-release create --policy-id ip-abc123 --body '{
  "addonName": "cloud-rds", "version": "1.2.29", "envType": "Cloud",
  "workspace": "my-ws", "values": "{}",
  "entityRules": { "entityTypes": ["acs.rds.instance"], "regionIds": ["cn-hangzhou"] }
}'

# Deploy from a JSON file
aliyun cms2 integration addon-release create --policy-id ip-abc123 --body @./release.json

Parameter

Type

Description

--policy-id

string

Integration policy ID. Required.

--body

string

Request body as inline JSON or @file.json. Required.

--show-example-body

bool

Print an example request body and exit.

--show-schema

bool

Print the JSON schema of the request body and exit.

Required body fields

Field

Description

addonName

Add-on name from the add-on catalog, such as cloud-acs-ack.

version

Add-on version. Use * for the latest version.

envType

Environment type (CS, ECS, or Cloud). Obtained from the add-on schema.

workspace

Workspace name.

values

An escaped JSON string that conforms to the add-on parameter schema, such as "{\"clusterId\":\"c123\"}".

Usage notes

  • values is an escaped JSON string, not a nested object.

  • For cloud-type add-ons, you can use the optional entityRules top-level field to control the monitoring scope: entityTypes (required, wildcards not supported) and regionIds (optional). You can further narrow the scope with one of resourceGroupId, tags, or instanceIds.

  • For cross-account CS integration, values.feePackage must be set to CS_Pro.

  • Before deployment, run integration addon get --addon-name <NAME> to view dependencies.services, and use aliyun-service status --service-name <svc> to confirm that dependent services are activated (skip entries whose names contain role as these are service-linked roles).

Get, list, update, and delete add-on releases

# Query a single addon release
aliyun cms2 integration addon-release get --policy-id ip-abc123 --release-id <id>

# List all addon releases under a policy
aliyun cms2 integration addon-release list --policy-id ip-abc123

# Update addon parameters
aliyun cms2 integration addon-release update --policy-id ip-abc123 --body @./release-update.json

# Delete an addon release
aliyun cms2 integration addon-release delete --policy-id ip-abc123 --release-id <id>

All subcommands above require --policy-id. For detailed parameter information on get, update, and delete, run the respective command with --help.

Limits

  • The list command returns a single page. It does not paginate automatically. Use the nextToken in the response to request the next page.

  • The create and update commands do not perform client-side schema validation on the request body. Field-level constraints are validated by the API.

  • The --tag parameter must be a JSON array with lowercase field names: [{"key":"k","value":"v"}].

  • For specific parameters of each subcommand, run aliyun cms2 integration <subcommand> --help.