All Products
Search
Document Center

Managed Service for OpenTelemetry:QueryMetric

Last Updated:Mar 19, 2024

Queries metrics.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

Authorization information

There is currently no authorization information disclosed in the API.

Request parameters

ParameterTypeRequiredDescriptionExample
IntervalInSecintegerYes

The time interval at which you want to query metric data. Unit: milliseconds. Minimum value: 60000.

Note If you set this parameter to 2147483647, all data in the specified time interval is returned.
100000
StartTimelongYes

The timestamp of the start time of the time range to query. The timestamp is accurate to milliseconds.

1575561600000
EndTimelongYes

The timestamp of the end time of the time range to query. The timestamp is accurate to milliseconds.

1575622455686
OrderBystringNo

The field based on which you want to sort the returned entries.

count
LimitintegerNo

The maximum number of entries that you want to return.

100
MetricstringYes

The name of the metric. Valid values:

  • appstat.incall: trace statistics
  • appstat.sql: SQL statistics
appstat.incall
OrderstringNo

The order in which you want to sort the returned entries. Valid values:

  • ASC: ascending order
  • DESC: descending order
ASC
ProxyUserIdstringNo

The ID of the proxy user.

testefgag12
Filtersobject []No

The filter conditions.

KeystringNo

The key of the field that you want to use to filter the returned entries.

http.status_code
ValuestringNo

The value of the field that you want to use to filter the returned entries.

200
DimensionsarrayNo

The dimensions of the metric that you want to query.

stringNo

The dimensions of the metric that you want to query.

pid
MeasuresarrayYes

The measures of the metric that you want to query.

stringYes

If you set the Metric parameter to appstat.incall, the Measures parameter has the following valid values:

  • rt: response time
  • count: total number of records that you want to return
  • error: number of errors
  • exception: exception
  • errorrate: error rate
  • qps: number of requests per second

If you set the Metric parameter to appstat.sql, the Measures parameter has the following valid values:

  • rt: response time
  • count: total number of records that you want to return
  • error: number of errors
  • slowcount: number of slow calls
rt

Response parameters

ParameterTypeDescriptionExample
object
Datastring

The returned statistics.

{ "RequestId": "E2373982-D8CD-413D-B991-8EB678******", "Data": "{\"data\":[{\"date\":1583686800000,\"count\":0,\"rt\":0,\"rpc\":\"childSpan3\"}}
RequestIdstring

The ID of the request.

1E2B6A4C-6B83-4062-8B6F-AEEC1F******

Examples

Sample success responses

JSONformat

{
  "Data": "{   \"RequestId\": \"E2373982-D8CD-413D-B991-8EB678******\",   \"Data\": \"{\\\"data\\\":[{\\\"date\\\":1583686800000,\\\"count\\\":0,\\\"rt\\\":0,\\\"rpc\\\":\\\"childSpan3\\\"}}",
  "RequestId": "1E2B6A4C-6B83-4062-8B6F-AEEC1F******"
}

Error codes

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
No change history