Queries the metrics of application monitoring. The query results are paginated.

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.

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:

  • ASC: ascending order
  • DESC: descending order
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: 1.

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 Application Monitoring > Applications. 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:

  • 2XX: The request is successful.
  • 3XX: A redirection message is returned.
  • 4XX: The request is invalid.
  • 5XX: A server error occurs.
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:

  • true: The call is successful.
  • false: The call fails.

Application monitoring metrics that can be queried

You can call the QueryMetricByPage operation to query the following application monitoring metrics.

Note
  • For the filters parameter, you must set the pid and regionId 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.
  • pid
  • rootIp
GCs:
  • youngGcCount: the number of GCs in the young generation
  • oldGcCount: the number of full heap GCs (Full GCs)
  • youngGcTime: the amount of time consumed to monitor GCs in the young generation
  • oldGcTime: the amount of time consumed to monitor Full GCs
  • youngGcCountInstant: the instantaneous value of the number of GCs in the young generation
  • oldGcCountInstant: the instantaneous value of the number of Full GCs
  • youngGcTimeInstant: the instantaneous value of the amount of time consumed to monitor GCs in the young generation
  • oldGcTimeInstant: the instantaneous value of the amount of time consumed to monitor Full GCs
Heap memory and non-heap memory:
  • EdenSpace: the eden space in the young generation
  • OldGen: the old generation
  • survivorSpace: the survivor space in the young generation
  • metaSpace: metaspace
  • nonHeapCommitted: the non-heap memory
  • nonHeapInit: the initial value of the non-heap memory
  • nonHeapMax: the maximum value of the non-heap memory
  • nonHeapUsed: the usage of the non-heap memory
  • directUsed: the amount of used direct buffer in the off-heap memory
  • directCapacity: the total amount of direct buffer in the off-heap memory
Threads:
  • threadCount: the total number of threads
  • threadNewCount: the number of new threads
  • threadDeadlockCount: the number of deadlocked threads in the JVM
  • threadRunnableCount: the number of runnable threads in the JVM
  • threadTerminatedCount: the number of terminated threads
  • threadTimedWaitCount: the number of threads in the timed_waiting state
  • threadWaitCount: the number of threads in the waiting state
  • threadBlockedCount: the number of blocked 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.
  • pid
  • rootIp
Instances:
  • instanceCount
CPU:
  • systemCpuIdle: the percentage of idle CPU in the last 5 seconds, which is not displayed in the ARMS console
  • systemCpuSystem: the percentage of CPU occupied by the system in the last 5 seconds
  • systemCpuUser: the percentage of CPU occupied by users in the last 5 seconds
  • systemCpuIoWait: the percentage of CPU consumed for I/O waiting in the last 5 seconds
Physical memory:
  • systemMemFree: the amount of free memory
  • systemMemUsed: the amount of used memory
  • systemMemTotal: the total amount of memory, which is not displayed in the ARMS console
  • systemMemBuffers: the amount of memory in the buffer cache
  • systemMemCached: the amount of memory in the page cache
Disks:
  • systemDiskFree: the size of free disk space in bytes
  • systemDiskUsedRatio: the usage of the disk space
  • SystemDiskTotal: the total size of disk space in bytes, which is not displayed in the ARMS console
Loads:
  • systemLoad
Network:
  • systemNetInPackets: the average number of packets received over the network per second in the last 30 seconds
  • systemNetOutPackets: the average number of packets sent over the network per second in the last 30 seconds
  • systemNetInErrs: the average number of frame errors that occur over the network per second in the last 30 seconds
  • systemNetOutErrs: the average number of errors sent over the network per second in the last 30 seconds
  • systemNetInBytes: the average number of bytes received over the network per second in the last 30 seconds
  • systemNetOutBytes: the average number of bytes sent over the network per second in the last 30 seconds
appstat.database A collection of metrics for database calls.
  • pid
  • rpcType: the type of the call
  • endpoint: The database endpoint, which is localhost: 3306
  • destId: the name of the database, which is arms
  • rt: the response time.
  • count: the number of requests.
  • error: the number of errors.
  • resultsize: This metric is available only when MySQL 5.x is used.
  • slowcount: the number of slow calls.
appstat.incall A collection of metrics related to application details.
  • pid
  • rpcType
  • rootIp
  • rpc
  • ppid
  • rt: the response time
  • count: the number of requests
  • error: the number of errors
  • exception: the number of exceptions
  • errorrate: the error rate
  • qps: the number of queries per second
appstat.exception A collection of metrics related to exceptions.
  • pid
  • rpc
  • endpoint
  • excepType
  • excepInfo
  • rt: the response time
  • count: the number of requests
  • error: the number of errors
appstat.sql A collection of metrics related to slow SQL queries.
  • pid
  • rpc
  • endpoint
  • sqlId
  • rt: the response time.
  • count: the number of requests.
  • error: the number of errors.
  • slow: the number of slow calls.
  • resultsize: This metric is available only when MySQL 5.x is used.
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
  • rt: the response time
  • count: the number of requests
  • error: the number of errors
  • delay: the latency in scheduling
appstat.mq.receive A collection of metrics related to message receiving by using Message Queue N/A
  • rt: the response time
  • count: the number of requests
  • error: the number of errors
  • delay: the latency in scheduling
appstat.schedulerx A collection of metrics related to SchedulerX calls.
  • pid
  • rpcType
  • rootIp
  • rpc
count: the number of requests
appstat.elasticsearch A collection of metrics related to Elasticsearch calls.
  • rpc
  • endpoint
  • opType: the type of the operation such as index and search operations. This dimension is supported only when elasticsearch-rest-high-level-client is used.
count: the number of requests
appstat.redis A collection of metrics related to ApsaraDB for Redis calls.
  • pid
  • rpcType
  • endpoint
  • opType
  • rpc
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.