Publish custom monitoring data to a namespace in Hybrid Cloud Monitoring and view monitoring charts for specific metrics on a dashboard.
Prerequisites
Activate Hybrid Cloud MonitoringBackground information
Activating Hybrid Cloud Monitoring is free of charge. You are billed based on actual usage. For more information about dashboard billing, see dashboards.
Procedure
- Install Alibaba Cloud CLI on the server where your custom monitoring data is located.
For information about how to install Alibaba Cloud CLI, see Install Alibaba Cloud CLI on Windows, Install Alibaba Cloud CLI on Linux, or Install Alibaba Cloud CLI on macOS.
Run the aliyun version command. If the current version of Alibaba Cloud CLI is returned, the installation is successful.
- Configure the AccessKey of your Alibaba Cloud account or RAM user on the server where your custom monitoring data is located.
For information about how to obtain an AccessKey for an Alibaba Cloud account or a RAM user, see Obtain an AccessKey.
For information about how to configure an AccessKey, see Configure an AccessKey credential.
The following output indicates that the AccessKey is configured:Configure Done!!! ..............888888888888888888888 ........=8888888888888888888D=.............. ...........88888888888888888888888 ..........D8888888888888888888888I........... .........,8888888888888ZI: ...........................=Z88D8888888888D.......... .........+88888888 ..........................................88888888D.......... .........+88888888 .......Welcome to use Alibaba Cloud.......O8888888D.......... .........+88888888 ............. ************* ..............O8888888D.......... .........+88888888 .... Command Line Interface(Reloaded) ....O8888888D.......... .........+88888888...........................................88888888D.......... ..........D888888888888DO+. ..........................?ND888888888888D.......... ...........O8888888888888888888888...........D8888888888888888888888=........... ............ .:D8888888888888888888.........78888888888888888888O .............. - Create a namespace on the Cloud Monitor console.
-
Log on to the Cloud Monitor console.
- In the left-side navigation pane, choose .
- Click Create Namespace.
- In the Manage Namespace panel, set the parameters.
Table 1. Parameters of a namespace
Parameter
Description
Namespace
Name of the namespace.
Data Storage Scheme
Storage scheme for metric data. Valid values:
-
Simple Log Service: Metrics are stored in Simple Log Service in your account.
-
Cloud Monitoring Storage: Metrics are stored in Cloud Monitor's private storage and accessible only through the Cloud Monitor console.
NoteFor available options, see Storage schemes of metric data in Hybrid Cloud Monitoring.
Region
Region where metric data is stored.
Retention Period
Retention period for metric data. Valid values:
-
cms.s1.large (Retention Period 15 Days)
-
cms.s1.xlarge (Retention Period 32 Days)
-
cms.s1.2xlarge (Retention Period 63 Days)
-
cms.s1.3xlarge (Retention Period 93 Days) (default)
-
cms.s1.6xlarge (Retention Period 185 Days)
-
cms.s1.12xlarge (Retention Period 367 Days)
-
cms.s1.36xlarge (Retention Period 1095 Days)
-
cms.s1.60xlarge (Retention Period 1825 Days)
-
cms.s1.120xlarge (Retention Period 3650 Days)
For pricing of different retention periods, see Pricing.
Namespace Description
Description of the namespace.
-
- Click OK.
-
- Publish custom monitoring data to a namespace in Hybrid Cloud Monitoring.
- Publish a single data point
aliyun cms PutHybridMonitorMetricData --region cn-hangzhou --MetricList.1.Name CPU_Usage --MetricList.1.Labels.1.Key=IP --MetricList.1.Labels.1.Value=192.168.XX.XX --MetricList.1.Value 90 --Namespace 'default-aliyun' - Publish multiple data points
aliyun cms PutHybridMonitorMetricData --region cn-hangzhou --MetricList.1.Name CPU_Usage --MetricList.1.Labels.1.Key=IP --MetricList.1.Labels.1.Value=192.168.XX.XX --MetricList.1.Labels.2.Key=IP --MetricList.1.Labels.2.Value=192.168.XX.XX --MetricList.1.Value 90 --Namespace 'default-aliyun'
For information about the parameters for the PutHybridMonitorMetricData operation, see PutHybridMonitorMetricData.
- Publish a single data point
- View the custom monitoring data on the Cloud Monitor console.
- In the left-side navigation pane, choose .
- (Optional) In the Metric Data column of the target namespace, click View Data.
- Select a metric to view its data.