Mengkueri data pemantauan di namespace.
Deskripsi operasi
Prerequisites
Hybrid Cloud Monitoring is activated. For more information, see Activate Hybrid Cloud Monitoring.
Limits
The size of monitoring data that is returned in each call cannot exceed 1.5 MB. If the returned data reaches the upper limit, the query fails. You must reset the query conditions.
Operation description
This topic provides an example to show how to query the monitoring data of the AliyunEcs_cpu_total metric in the default-aliyun namespace from 1653804865 (14:14:25 on May 29, 2022) to 1653805225 (14:20:25 on May 29, 2022).
Coba sekarang
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
cms:DescribeCustomMetricDataPoint |
list |
*全部资源
|
None | None |
Parameter permintaan
|
Parameter |
Type |
Required |
Description |
Example |
| Namespace |
string |
Yes |
Nama namespace. Untuk informasi selengkapnya tentang cara mengkueri nama namespace, lihat DescribeHybridMonitorNamespaceList. |
default-aliyun |
| PromSQL |
string |
Yes |
Nama metrik. Catatan
Pernyataan PromQL didukung. |
AliyunEcs_cpu_total |
| Start |
integer |
Yes |
Awal rentang pengatur waktu untuk kueri. Unit: detik. |
1653804865 |
| End |
integer |
Yes |
Akhir rentang pengatur waktu untuk kueri. Unit: detik. |
1653805225 |
| Period |
string |
No |
Periode statistik data pemantauan. Unit: detik. |
60 |
Untuk informasi selengkapnya tentang parameter permintaan umum, lihat Parameter umum.
Elemen respons
|
Element |
Type |
Description |
Example |
|
object |
None. |
||
| Code |
string |
The response code. Catatan
The status code 200 indicates that the request was successful. |
200 |
| Message |
string |
The returned message. |
end timestamp must not be before start time. |
| RequestId |
string |
The request ID. |
C240412F-3F5F-50E2-ACEC-DE808EF9C4BE |
| Success |
string |
Indicates whether the request was successful. Valid values:
|
true |
| TimeSeries |
array<object> |
The returned monitoring data. |
|
|
array<object> |
|||
| MetricName |
string |
The metric name. |
AliyunEcs_cpu_total |
| Labels |
array<object> |
The tags of the time dimension. |
|
|
object |
|||
| K |
string |
The tag key. |
instanceId |
| V |
string |
The tag value. |
i-rj99xc6cptkk64ml**** |
| Values |
array<object> |
The metric values that are collected at different timestamps. |
|
|
object |
|||
| V |
string |
The metric value. |
0.13 |
| Ts |
string |
The timestamp that indicates the time when the metric value is collected. Unit: seconds. |
1653804865 |
Contoh
Respons sukses
JSONformat
{
"Code": "200",
"Message": "end timestamp must not be before start time.",
"RequestId": "C240412F-3F5F-50E2-ACEC-DE808EF9C4BE",
"Success": "true",
"TimeSeries": [
{
"MetricName": "AliyunEcs_cpu_total",
"Labels": [
{
"K": "instanceId",
"V": "i-rj99xc6cptkk64ml****"
}
],
"Values": [
{
"V": "0.13",
"Ts": "1653804865"
}
]
}
]
}
Kode kesalahan
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | %s | %s | |
| 400 | BadRequest | Bad request. | |
| 500 | InternalError | %s | |
| 403 | %s | %s | |
| 404 | %s | %s | |
| 409 | %s | Resources already exist. |
Lihat Error Codes untuk daftar lengkap.
Catatan rilis
Lihat Release Notes untuk daftar lengkap.