Queries the metrics of Browser Monitoring.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes QueryMetricByPage

The operation that you want to perform. Set the value to QueryMetricByPage.

IntervalInSec Integer Yes 60000

The time interval at which data entries are aggregated. Unit: milliseconds. Minimum value: 60000.

StartTime Long Yes 1595319532000

The start of the time range to query. Unit: milliseconds.

EndTime Long Yes 1596183532000

The end of the time range to query. Unit: milliseconds.

OrderBy String No rpc

The measure by which metrics are sorted.

Metric String Yes webstat.index

The metric that you want to query. You cannot specify custom metrics. For more information, see the Browser Monitoring metrics that can be queried section in this topic.

Order String No ASC

The order in which metrics are sorted. Valid values:

  • ASC: ascending order
  • DESC: descending order
RegionId String Yes cn-hangzhou

The ID of the region in which the resource resides.

CurrentPage Integer No 1

The number of the page to return. This parameter is optional. Default value: 1.

PageSize Integer No 10

The number of entries to return on each page.

Filters.N.Key String No pid

The key of a filter condition. You can configure multiple filter conditions, but you must configure the conditions whose keys are pid and regionId.

Filters.N.Value String No xxx@74xxx

The value of a filter condition. You can configure multiple filter conditions, but you must specify the values of the pid and regionId conditions. For more information about how to obtain the pid value, see Obtain the PID of an application.

Dimensions.N String No ["detector_browser","detector_device"]

The dimensions of the metric that you want to query. For more information, see the Browser Monitoring metrics that can be queried section in this topic. You can specify a maximum of five dimensions.

Measures.N String No pv

The measures of the metric that you want to query. For more information, see the Browser Monitoring metrics that can be queried section in this topic. You can specify a maximum of five measures.

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 ARMS console. In the left-side navigation pane, click Browser Monitoring. On the Browser Monitoring page, click the name of an application to go to the overview page of the application.

The URL in the address bar contains the process ID (PID) of the application, which is indicated in the pid=xxx format. The PID is usually percent encoded as xxx%40xxx. You must modify this value to remove the percent encoding. For example, if the PID in the URL is eb4zdose6v%409781be0f44d****, you must replace %40 with @ to obtain eb4zdose6v@9781be0f44d****.

Browser Monitoring metrics that can be queried

You can call the QueryMetric operation to query the following metrics of Browser Monitoring.

Note
  • You must set the pid and regionId filter conditions by specifying the Filters parameter.
  • You must set all known filter conditions by specifying the Filters parameter to define the range of query results. If no filter conditions are known, you can specify one or more dimensions provided in the following table to narrow down the query range.

Metric

Description

Dimension

Measure

webstat.api

Success rate of API calls

  • api: the URL of the API call without parameters
  • detector_app_version: the client version
  • detector_browser: the browser
  • detector_device: the device
  • detector_os: the operating system
  • ip_country_id: the ID of the country or area
  • ip_region_id: the ID of the region
  • release: the version number
  • sr: the screen resolution
  • count: the number of requests
  • rate: the success rate of API calls
  • avg_time: the average response time

webstat.api.detail

API details

  • api: the URL of the API call without parameters
  • ct: the network connection type
  • detector_browser: the browser
  • detector_browser_version: the version of the browser
  • detector_device: the device
  • detector_os: the operating system
  • detector_os_version: the version of the operating system
  • domain: the domain name
  • ip_country_id: the ID of the country or area
  • ip_isp: the carrier
  • ip_region_id: the ID of the region
  • msg: the returned message
  • page: the URL of the page
  • sr: the screen resolution
  • count: the number of requests
  • fail_count: the number of failed API calls
  • fail_time: the response time for failed API calls
  • fail_uv: the number of users affected by failures
  • success_count: the number of successful API calls
  • success_rate: the success rate
  • success_time: the response time for successful API calls

webstat.apicost

Response time for successful API calls

  • api: the API request address without parameters
  • code: the returned status code
  • detector_app_version: the client version
  • detector_browser: the browser
  • detector_device: the device
  • detector_os: the operating system
  • ip_country_id: the ID of the country or area
  • ip_region_id: the ID of the region
  • release: the version number
  • sr: the screen resolution
  • count: the number of successful API calls
  • avg_time: the average response time for successful API calls

webstat.apifailtime

Response time for failed API calls

  • api: the URL of the API call without parameters
  • code: the returned status code
  • detector_app_version: the client version
  • detector_browser: the browser
  • detector_device: the device
  • detector_os: the operating system
  • ip_country_id: the ID of the country or area
  • ip_region_id: the ID of the region
  • release: the version number
  • sr: the screen resolution
  • count: the number of failed API calls
  • avg_time: the average response time for failed API calls

webstat.apimsg

Classification and aggregation of API response messages

  • code: the returned status code
  • detector_app_version: the client version
  • detector_browser: the browser
  • detector_device: the device
  • detector_os: the operating system
  • ip_country_id: the ID of the country or area
  • ip_region_id: the ID of the region
  • msg: the error message
  • release: the version number
  • sr: the screen resolution
  • success: The value 1 indicates that the request is successful and 0 indicates that the request has failed.

count: the number of requests

webstat.avg

Custom statistics: average

  • detector_browser: the browser
  • detector_device: the device
  • detector_os: the operating system
  • ip_country_id: the ID of the country or area
  • ip_region_id: the ID of the region
  • key: the custom key
  • sr: the screen resolution
  • count: the total number of occurrences of specified events
  • pv: the number of page views
  • uv: the number of unique visitors
  • avg_val: the average value

webstat.errcate

Error message ranking

  • msg: the error message
  • ip_country_id: the ID of the country or area
  • ip_region_id: the ID of the region
  • detector_browser: the browser
  • detector_device: the device
  • detector_os: the operating system
  • sr: the screen resolution
  • release: the version number
  • environment: the environment
  • detector_app_version: the client version
  • detector_app: the client app

count: the number of failed API calls

webstat.index

Page view overview

  • ct: the network connection type
  • detector_browser: the browser
  • detector_device: the device
  • detector_os: the operating system
  • ip_country_id: the ID of the country or area
  • ip_isp: the carrier
  • ip_region_id: the ID of the region
  • page: the URL of the page
  • sr: the screen resolution
  • pv: the number of page views
  • uv: the number of unique visitors

webstat.msg.top

Frequent errors

  • msg: the error message
  • page: the URL of the page
  • count: the number of failed API calls
  • error_uv: the number of affected users
  • Ratio of affected users: the ratio obtained by dividing affected users by total UVs

webstat.perf.bucket

Performance Sample Distribution section on the Page Speed page in the ARMS console

  • detector_browser: the browser
  • detector_device: the device
  • detector_os: the operating system
  • ip_country_id: the ID of the country or area
  • ip_region_id: the ID of the region
  • page: the URL of the page
  • sr: the screen resolution
  • cfpt: the time that you estimate and preset for the first pixel to be painted on the screen
  • ctti: the time that you estimate and preset for a webpage to become fully interactive
  • dns: the time used for the DNS query
  • dom: the time used for the DOM resolution
  • fmp: the time taken for the primary content of the page to become visible
  • fpt: the time taken for the first pixel to be painted on the screen
  • load: the time taken for the page to be completely loaded
  • ready: the time taken for the DOM to become ready
  • res: the time used to load resources
  • ssl: the time used to establish an SSL connection
  • t1\~t10: the custom performance metrics
  • tcp: the time used to establish a TCP connection
  • trans: the time used to transfer data
  • ttfb: the response time to a request
  • tti: the time taken for a webpage to become fully interactive

webstat.perf.distribution

Performance Stacked Area Chart on the Page Speed page in the ARMS console

  • detector_browser: the browser
  • detector_device: the device
  • detector_os: the operating system
  • ip_country_id: the ID of the country or area
  • ip_region_id: the ID of the region
  • page: the URL of the page
  • sr: the screen resolution
  • cfpt: the time that you estimate and preset for the first pixel to be painted on the screen
  • ctti: the time that you estimate and preset for a webpage to become fully interactive
  • dns: the time used for the DNS query
  • dom: the time used for the DOM resolution
  • fmp: the time taken for the primary content of the page to become visible
  • fpt: the time taken for the first pixel to be painted on the screen
  • load: the time taken for the page to be completely loaded
  • ready: the time taken for the DOM to become ready
  • res: the time used to load resources
  • ssl: the time used to establish an SSL connection
  • t1\~t10: the custom performance metrics
  • tcp: the time used to establish a TCP connection
  • trans: the time used to transfer data
  • ttfb: the response time to a request
  • tti: the time taken for a webpage to become fully interactive

webstat.resource

Resource error ranking

  • ct: the network connection type
  • detector_browser: the browser
  • detector_device: the device
  • detector_os: the operating system
  • ip_country_id: the ID of the country or area
  • ip_isp: the carrier
  • ip_region_id: the ID of the region
  • node_name: the error type
  • page: the URL of the page
  • sr: the screen resolution
  • src: the resource information

count: the number of resource errors

webstat.resource

Resource Error section on the Overview page in the ARMS console

  • ct: the network connection type
  • detector_browser: the browser
  • detector_device: the device
  • detector_os: the operating system
  • ip_country_id: the ID of the country or area
  • ip_isp: the carrier
  • ip_region_id: the ID of the region
  • node_name: the error type
  • page: the URL of the page
  • sr: the screen resolution
  • src: the resource information

count: the number of resource errors

webstat.satisfy

Satisfaction

  • detector_browser: the browser
  • detector_device: the device
  • detector_os: the operating system
  • ip_country_id: the ID of the country or area
  • ip_region_id: the ID of the region
  • page: the URL of the page
  • sr: the screen resolution
  • bad: frustrated, indicating that the value of fpt is greater than 8,000
  • good: satisfied, indicating that the value of fpt is smaller than 2,000
  • neutral: tolerable, indicating that the value of fpt is between 2,000 and 8,000
  • satisfy: Application Performance Index (Apdex)

webstat.session

Slow loading troubleshooting

None

  • browser_version: the browser version
  • browser: the browser
  • date: the start time of the data query
  • dom: the time used for the DOM resolution
  • ip_country_id: the ID of the country or area
  • ip_country: the name of the country or area
  • ip_region_id: the ID of the region
  • ip_region: the name of the region
  • load: the time taken for the page to be completely loaded
  • page: the URL of the page
  • sid: the session ID

webstat.speed

Access speed

  • detector_browser: the browser
  • detector_device: the device
  • detector_os: the operating system
  • ip_country_id: the ID of the country or area
  • ip_region_id: the ID of the region
  • release: the version number
  • sr: the screen resolution
  • page: the URL of the page
  • environment: the environment
  • avg_cfpt: the average of the time that you estimate and preset for the first pixel to be painted on the screen
  • count: the number of samples
  • avg_ctti: the average of the time that you estimate and preset for a webpage to become fully interactive
  • avg_dns: the average time used for the DNS query
  • avg_dom: the average time used for the DOM resolution
  • avg_fmp: the average time taken for the primary content of the page to become visible
  • avg_fpt: the average time taken for the first pixel is to be painted on the screen
  • avg_load: the average time taken for the page to be completely loaded
  • avg_ready: the average time taken for the DOM to become ready
  • avg_res: the average time used to load resources
  • avg_ssl: the average time used to establish an SSL connection
  • avg_t1\~t10: the custom performance metrics
  • avg_tcp: the average time used to establish a TCP connection
  • avg_trans: the average time used to transfer data
  • avg_ttfb: the average response time to a request
  • avg_tti: the average time taken for a webpage to become fully interactive

webstat.stable

Error rate ranking

  • page: the URL of the page
  • ip_country_id: the ID of the country or area
  • ip_region_id: the ID of the region
  • detector_browser: the browser
  • detector_device: the device
  • detector_os: the operating system
  • sr: the screen resolution
  • msg: the error message
  • release: the version number
  • environment: the environment
  • detector_app_version: the client version
  • detector_app: the client app
  • count: the number of samples
  • error_pv: the number of JS errors
  • rate: JS error rate

webstat.sum

Custom statistics: sum

  • detector_browser: the browser
  • detector_device: the device
  • detector_os: the operating system
  • ip_country_id: the ID of the country or area
  • ip_region_id: the ID of the region
  • key: the custom key
  • sr: the screen resolution
  • count: the total number of occurrences of specified events
  • pv: the number of page views
  • sum_val: the total value
  • uv: the number of unique visitors

webstat.url

Access URL

  • detector_browser: the browser
  • detector_device: the device
  • detector_os: the operating system
  • ip_country_id: the ID of the country or area
  • ip_region_id: the ID of the region
  • sr: the screen resolution
  • uid
  • username: the username
  • pv: the number of page views
  • uv: the number of unique visitors

Response parameters

Parameter Type Example Description
Code String 200

The HTTP status code returned for the request. Valid values:

  • 2XX: The request is successful.
  • 3XX: A redirection message is returned.
  • 4XX: The request is invalid.
  • 5XX: A server error occurs.
Message String message

The error message returned if the call fails.

RequestId String 626037F5-FDEB-45B0-804C-B3C92797****

The ID of the request.

Success Boolean true

Indicates whether the call is successful. Valid values:

  • true: The call is successful.
  • false: The call has failed.
Data Object

The struct returned.

PageSize Integer 10

The number of entries returned per page.

Total Integer 0

The total number of entries returned.

Page Integer 1

The page number of the returned page.

Items Array of Object []

The list of data entries returned.

Examples

Sample requests

http(s)://[Endpoint]/?Action=QueryMetricByPage
&IntervalInSec=60000
&StartTime=1595319532000
&EndTime=1596183532000
&OrderBy=rpc
&Metric=webstat.index
&Order=ASC
&CurrentPage=1
&PageSize=10
&Filters=[{"Key":"pid","Value":"xxx@74xxx"}]
&Dimensions=["[\"detector_browser\",\"detector_device\"]"]
&Measures=["pv"]
&CustomFilters=["[\"not rpcType:40\",\"not rpcType:41\"]"]
&<Common request parameters>

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<QueryMetricByPageResponse>
    <Code>200</Code>
    <Message>message</Message>
    <RequestId>626037F5-FDEB-45B0-804C-B3C92797****</RequestId>
    <Success>true</Success>
    <Data>
        <PageSize>10</PageSize>
        <Total>0</Total>
        <Page>1</Page>
        <Items/>
    </Data>
</QueryMetricByPageResponse>

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

{
  "Code" : 200,
  "Message" : "message",
  "RequestId" : "626037F5-FDEB-45B0-804C-B3C92797****",
  "Success" : true,
  "Data" : {
    "PageSize" : 10,
    "Total" : 0,
    "Page" : 1,
    "Items" : ""
  }
}

Error codes

For a list of error codes, visit the API Error Center.

FAQ

  • Why does an error about the RAM permissions occur when I call the API?

    This is because the RAM user does not have required permissions. You can grant the permissions to the RAM user. For more information, see Use a RAM role to access resources across Alibaba Cloud accounts.

  • How do I obtain a list of data entries without specifying a time interval?

    Set the intervalInSec 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 intervalInSec parameter is greater than or equal to 60,000.
    • Check whether the value of the regionId parameter is valid. The value depends 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 URL 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?
  • Why does an error occur when I call the simulator or an API?
    • Check whether the regionId parameter is specified and whether the pid parameter is specified by using the Filters parameter.
    • Check whether you have specified a valid value of the Measures or Dimensions parameter for the metric. For more information, see the Browser Monitoring metrics that can be queried section in this topic.
  • 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 pid parameter is specified by using the Filters parameter.
    • InvalidIntervalInSec

      Check whether the value of the intervalInSec parameter exceeds the maximum value 2,147,483,647.

    • MissingMeasures

      Check whether the Measures parameter is specified.

    • NonsequenceParameter.Dimensions
      • Check whether the value of the Dimensions parameter is valid.
      • Check whether the value of the Dimensions parameter contains 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 value depends 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 URL 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?
  • Why are some Measures or Dimensions parameters missing from my dataset?

    This happens because you can specify a maximum of five Measures or Dimensions parameters. If more than five parameters are specified, no data can be returned.

  • Why does the sum of some metrics significantly decrease after they are aggregated compared with when they were not aggregated? For example, when the values of the pv parameter for the webstat.index metric are aggregated, the sum of aggregated values is significantly less than the sum of all the individual values.

    The API gateway admits a maximum of 10,000 data entries at a time. Additional data entries are discarded. When you attempt to aggregate more than 10,000 data entries, only the first 10,000 data entries are aggregated and the rest are discarded. This causes the aggregated result to be far less than the result of individually adding all the values. You must make sure that no more than 10,000 data entries are returned for each request. This ensures that you can obtain an accurate aggregated value.