Queries the metrics of application monitoring. The query results are paginated.
Debugging
Request parameters
Parameter | Type | Required | Example | Description |
---|---|---|---|---|
Action | String | Yes | QueryMetricByPage | The operation that you want to perform. Set the value to |
EndTime | Long | Yes | 1596183532000 | The end of the time range to query. Unit: milliseconds. |
IntervalInSec | Integer | Yes | 60000 | The time interval between the data shards that you want to query. Unit: milliseconds. Minimum value: 60000. |
Measures.N | RepeatList | Yes | youngGcCount | The measures of the metric that you want to query. For more information, see the Application monitoring metrics that can be queried section in this topic. You can specify a maximum of five measures. |
Metric | String | Yes | appstat.vm | The metric that you want to query. You cannot specify custom metrics. For more information, see the Application monitoring metrics that can be queried section in this topic. |
StartTime | Long | Yes | 1595319532000 | The beginning of the time range to query. Unit: milliseconds. |
OrderBy | String | No | rpc | The dimension from which metrics are sorted. You can set this parameter to a supported dimension. |
Filters.N.Key | String | Yes | pid | The filter condition for the query. The pid and regionId parameters are required. For information about how to obtain the PID , see Obtain the PID of an application. |
Filters.N.Value | String | Yes | atc889zkcf@d8deedfa9****** | The filter condition for the query. The pid and regionId parameters are required. For information about how to obtain the PID , see Obtain the PID of an application. |
Dimensions.N | RepeatList | No | pid | The dimension from which metrics are queried. For more information, see the Application monitoring metrics that can be queried section in this topic. You can specify a maximum of five metrics. |
Order | String | No | ASC | The order in which metrics are sorted. Valid values:
Note If you do not specify the parameter, data is not sorted.
|
RegionId | String | Yes | cn-hangzhou | The region ID of the security group. |
CurrentPage | Integer | No | 1 | Optional. The number of the page to return. Default value: |
PageSize | Integer | No | 10 | The number of entries to return on each page. |
CustomFilters.N | String | No | ["not rpcType:40","not rpcType:41"] | Custom filter conditions. Separate multiple filter conditions with commas (,). |
Obtain the PID of an application
Log on to the Application Real-Time Monitoring Service console.In the top navigation bar, select a region. In the left-side navigation pane, choose . On the Applications page, click the name of the application that you want to query to open the overview page of this application.
The URL in the browser address bar contains the pid of this application in the format of pid=xxx
. Data is encoded in the browser. Therefore, you must modify the obtained PID of an application except for one in Enterprise Distributed Application Service (EDAS). For example, if the PID in the URL is xxx%4074xxx
, you must replace %40
with the at sign (@
). The actual PID is xxx@74xxx
.
Response parameters
Parameter | Type | Example | Description |
---|---|---|---|
Code | String | 200 | The HTTP status code returned for the request. Valid values:
|
Data | Struct | The struct returned. |
|
Items | List | [] | The list of data entries returned. |
Page | Integer | 1 | The page number of the returned page. |
PageSize | Integer | 10 | The number of entries returned per page. |
Total | Integer | 0 | The total number of entries returned. |
Message | String | StartTime is mandatory for this action. | The message that is returned if a request parameter is invalid. |
RequestId | String | 626037F5-FDEB-45B0-804C-B3C92797**** | The ID of the request. |
Success | Boolean | true | Indicates whether the call is successful. Valid values:
|
Application monitoring metrics that can be queried
You can call the QueryMetricByPage operation to query the following application monitoring metrics.
- For the filters parameter, you must set the
pid
andregionId
filter conditions. - If you have obtained the PID and region ID of your application, add the values to the filters parameter to filter data. If you have not obtained the PID or region ID, specify one or more dimensions provided in the following table for the dimensions parameter to filter data.
Metric | Description | Dimensions | Measures |
---|---|---|---|
appstat.vm | A collection of common metrics that are shown in the Java virtual machine (JVM) monitoring chart on the application details page. These metrics are related to garbage collections (GCs), heap memory, non-heap memory, and threads. |
|
GCs:
|
Heap memory and non-heap memory:
|
|||
Threads:
|
|||
appstat.host | A collection of metrics for host monitoring. These metrics are related to instances, CPU, physical memory, disk, load, network traffic, and network packets. |
|
Instances:
|
CPU:
|
|||
Physical memory:
|
|||
Disks:
|
|||
Loads:
|
|||
Network:
|
|||
appstat.database | A collection of metrics for database calls. |
|
|
appstat.incall | A collection of metrics related to application details. |
|
|
appstat.exception | A collection of metrics related to exceptions. |
|
|
appstat.sql | A collection of metrics related to slow SQL queries. |
|
Note If the value of the slow metric is true, the filter conditions do not take effect.
|
appstat.mq.send | A collection of metrics related to message sending by using Message Queue | N/A |
|
appstat.mq.receive | A collection of metrics related to message receiving by using Message Queue | N/A |
|
appstat.schedulerx | A collection of metrics related to SchedulerX calls. |
|
count: the number of requests |
appstat.elasticsearch | A collection of metrics related to Elasticsearch calls. |
|
count: the number of requests |
appstat.redis | A collection of metrics related to ApsaraDB for Redis calls. |
|
count: the number of requests |
Examples
Sample requests
http(s)://[Endpoint]/?Action=QueryMetricByPage
&EndTime=1596183532000
&IntervalInSec=60000
&Measures.1=youngGcCount
&Metric=appstat.vm
&StartTime=1595319532000
&<Common request parameters>
Sample success responses
XML
format
<QueryMetricByPageResponse>
<RequestId>626037F5-FDEB-45B0-804C-B3C92797****</RequestId>
<Data>
<PageSize>10</PageSize>
<Total>0</Total>
<Page>1</Page>
<Items>[]</Items>
</Data>
<Code>200</Code>
<Success>true</Success>
</QueryMetricByPageResponse>
JSON
format
{
"RequestId": "626037F5-FDEB-45B0-804C-B3C92797****",
"Data": {
"PageSize": 10,
"Total": 0,
"Page": 1,
"Items": []
},
"Code": 200,
"Success": true
}
Error codes
For a list of error codes, visit the API Error Center.