Queries the metrics of Application Monitoring.
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 to be queried. Unit: milliseconds. Minimum value: 60,000. |
Measures.N | RepeatList | Yes | pv | The measurement data of the metric. For more information, see Queryable Application Monitoring metrics. You can add a maximum of five measurement data entries. |
Metric | String | Yes | webstat.index | The metrics that you want to query. You cannot query custom metrics. For more information, see Queryable Application Monitoring metrics. |
StartTime | Long | Yes | 1595319532000 |
The beginning of the time range to query. Unit: milliseconds. |
OrderBy | String | No | rpc |
The measurement data entry by which metrics are sorted. You can set this parameter to a type of measurement data. |
Filters.N.Key | String | Yes | pid | The filtering 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 | xxx@74xxx | The filtering 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 | ["detector_browser","detector_device"] | The dimension by which metrics are queried. For more information, see Queryable Application Monitoring metrics. You can add a maximum of five measurement data entries. |
Order | String | No | ASC |
The measurement data entry by which metrics are sorted. Valid values:
|
RegionId | String | No | cn-hangzhou |
The ID of the region. |
CurrentPage | Integer | No | 1 |
The number of the page to return. Optional. Default value: |
PageSize | Integer | No | 10 |
The number of entries to return on each page. |
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 Browser Monitoring 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
. The browser is encoded. Therefore, you must modify the pid of all applications except for those in Enterprise Distributed Application Service
(EDAS). For example, if the PID in the URL is xxx%4074xxx
, you must replace %40
with @
. The PID is modified to xxx@74xxx
.
Response parameters
Parameter | Type | Example | Description |
---|---|---|---|
Code | String | 200 |
The status of the API. Valid values:
|
Data | Struct |
The returned data struct. |
|
Items | List | [] |
The list of returned data structs. |
Page | Integer | 1 |
The page number of the returned page. |
PageSize | Integer | 10 |
The number of entries returned per page. |
Total | Integer | 0 |
The sum of queries. |
Message | String | message |
The returned message. |
RequestId | String | 626037F5-FDEB-45B0-804C-B3C92797**** |
The ID of the request. |
Success | Boolean | true |
Indicates whether the query was successful. Valid values:
|
Queryable Application Monitoring metrics
You can call the QueryMetricByPage operation to query the following metrics of Application Monitoring.
- You must specify
pid
andregionId
in Filters. - If you have obtained the values of the PID and regionId parameters, add the values to the filters parameter to define the range of query results. If you have not obtained the values of the PID and regionId parameters, pass the dimensions in the following table to the dimensions parameter to obtain a list of all possible values.
Metric | Description | Dimension | Measurement data |
---|---|---|---|
appstat.vm | Common metrics that are shown on the JVM monitoring chart of the application details page. These metrics include garbage collection (GC), heap memory, non-heap memory, and number of threads. |
|
GC:
|
Details of the heap memory and non-heap memory:
|
|||
Number of threads:
|
|||
appstat.host | Host monitoring metrics. These metrics include the number of instances, CPU, physical memory, disk, load, network traffic (in bytes), and number of network packets. |
|
Number of instances:
|
CPU:
|
|||
Physical memory:
|
|||
Disk:
|
|||
Load:
|
|||
Network:
|
|||
appstat.database | Database call |
|
|
appstat.txn | API call. |
|
|
appstat.incall | Application details |
|
|
appstat.exception | Exception |
|
|
appstat.sql | Slow SQLs |
|
Note If you set slow to true, the limit parameter does not take effect.
|
appstat.mq.send | Message Queue (MQ) message sending | N/A |
|
appstat.mq.receive | MQ message receiving | N/A |
|
Examples
Sample requests
http(s)://[Endpoint]/? Action=QueryMetricByPage
&EndTime=1596183532000
&IntervalInSec=60000
&Measures.1=pv
&Metric=webstat.index
&StartTime=1595319532000
&<Common request parameters>
Sample success responses
XML
format
<QueryMetricByPageResponse>
<RequestId>626037F5-FDEB-45B0-804C-B3C92797****</RequestId>
<Message>message</Message>
<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****",
"Message": "message",
"Data": {
"PageSize": 10,
"Total": 0,
"Page": 1,
"Items": "[]"
},
"Code": 200,
"Success": true
}