Queries the metrics of Browser 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 Browser 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 Browser 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 parameter of the filter condition for the query. The |
Filters.N.Value | String | Yes | xxx@74xxx |
The value of the filter condition for the query. The |
Dimensions.N | RepeatList | No | ["detector_browser","detector_device"] |
The dimension by which metrics are queried. For more information, see Queryable Browser Monitoring metrics. You can add a maximum of five dimensions. |
Order | String | No | ASC |
The dimension by which metrics are sorted. Valid values:
|
RegionId | String | No | cn-hangzhou |
The ID of the region. |
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. |
Obtain the PID of an application
Log on to the Application Real-Time Monitoring Service (ARMS) console.In the left-side navigation pane, click Browser Monitoring. On the Browser Monitoring page, click the name of the application that you want to query to go to 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 applications. 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 Browser Monitoring metrics
You can call the QueryMetric operation to query the following metrics of Browser Monitoring.
- You must set the
pid
andregionId
parameters in the filters parameter. - 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, add the dimensions in the following table to the dimensions parameter to obtain a list of all possible values.
Metric | Description | Dimension | Measurement data |
---|---|---|---|
webstat.api | Success rate of API calls |
|
|
webstat.api.detail | API details |
|
|
webstat.apicost | Response time for successful API calls |
|
|
webstat.apifailtime | Response time for failed API calls |
|
|
webstat.apimsg | API message clustering |
|
count: the number of requests |
webstat.avg | Custom statistics: average |
|
|
webstat.errcate | Error message ranking |
|
count: the number of errors |
webstat.index | Page view overview |
|
|
webstat.msg.top | Frequent errors |
|
|
webstat.perf.bucket | Performance Stacked Area Chart on the Page Speed page in the ARMS console |
|
|
webstat.perf.distribution | Performance Stacked Area Chart on the Page Speed page in the ARMS console |
|
|
webstat.resource | Resource error ranking |
|
count: the number of resource errors |
webstat.resource | Resource Error on the Overview page in the ARMS console |
|
count: the number of resource errors |
webstat.satisfy | Satisfaction |
|
|
webstat.session | Slow loading tracking | N/A |
|
webstat.speed | Page speed |
|
|
webstat.stable | Error rate ranking |
|
|
webstat.sum | Custom statistics: sum |
|
|
webstat.url | Access URL |
|
|
Examples
Sample request
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
}
FAQ
-
Why does a RAM permission error occur when I call the API?
This is because the RAM user does not have permissions. You can grant permissions to the RAM user. For more information, see Use a RAM role to access resources across Alibaba Cloud accounts.
-
How do I query a list of data entries without specifying a time interval?
Set the intervalinsc parameter to 2147483647.
-
Why is 0 returned for all the queries?
- Check whether the time interval that you set is too short. Make sure that the value of the intervalinfo parameter is greater than or equal to 60,000.
- Check whether the value of the regionId parameter is valid. The regionId parameter is set based on the region where the server that receives logs resides,
rather than the region where you reside. You can identify the region ID based on the
following URLs of the log source:
- URL of the log source in the China (Hangzhou) region:
https://arms-retcode.aliyuncs.com/r.png?
- URL of the log source in the Singapore region:
https://arms-retcode-sg.aliyuncs.com/r.png?
- URL of the log source in the US (Silicon Valley) region:
https://retcode-us-west-1.arms.aliyuncs.com/r.png?
- URL of the log source in the China (Hangzhou) region:
-
Why does an error occur when I call the simulator or API?
- Check whether the regionId parameter is set and the value of the pid parameter is added to the filters parameter.
- Check whether the value of the measures or dimensions parameter of a metric is valid. For more information, see Queryable Browser Monitoring metrics.
-
Error messages and solutions
- Query error. Contact the administrator.
- Check whether the value of the Metric parameter is valid.
- Check whether the value of the measures or dimensions parameter is valid.
- Check whether the value of the pid parameter is added to the filters parameter.
- InvalidIntervalInSec
Check whether the value of the intervalInSec parameter exceeds the maximum value, that is, 2147483647.
- MissingMeasures
Check whether the measures parameter is specified.
- NonsequenceParameter.Dimensions
- Check whether the value of the dimensions parameter is valid.
- Check the simulator dimensions for extra spaces.
- ServiceUnavailable
Check whether the value of the regionId parameter is valid.
- Invalid Region
Check whether the value of the regionId parameter is valid. The regionId parameter is set based on the region where a server that receives logs resides, rather than the region where you reside. You can identify the region ID based on the following URLs of the log source:
- URL of the log source in the China (Hangzhou) region:
https://arms-retcode.aliyuncs.com/r.png?
- URL of the log source in the Singapore region:
https://arms-retcode-sg.aliyuncs.com/r.png?
- URL of the log source in the US (Silicon Valley) region:
https://retcode-us-west-1.arms.aliyuncs.com/r.png?
- URL of the log source in the China (Hangzhou) region:
- Query error. Contact the administrator.
- Why are some parameters in the measures or dimensions parameters missing from my dataset?
That is because you can specify a maximum of five measurement data entries or dimensions. If more than five of them are specified, no responses can be returned.
- Why does the total number of metrics significantly decrease after they are aggregated?
For example, the total number of PVs summed by webstat.index significantly decreases after the PVs are aggregated.
A maximum of 10,000 data entries are returned due to the limit of the point of presence (PoP). If data is aggregated, the data volume is increased and only some data entries are returned. Therefore, the total number of metrics decreases. You must make sure that less than 10,000 data entries are returned for each request. This ensures that you can obtain accurate data.