Domain name for API request: cls.intl.tencentcloudapi.com.
Query the latest metric value at a specified time.
If there is no metric data in the 5 minutes before that moment, there will be no query result.
A maximum of 20 requests can be initiated per second for this API.
The following request parameter list only provides API request parameters and some common parameters. For the complete common parameter list, see Common Request Parameters.
| Parameter Name | Required | Type | Description |
|---|---|---|---|
| Action | Yes | String | Common Params. The value used for this API: QueryMetric. |
| Version | Yes | String | Common Params. The value used for this API: 2020-10-16. |
| Region | Yes | String | Common Params. For more information, please see the list of regions supported by the product. |
| Query | Yes | String | Queries statements; using PromQL syntax -Refer to the Syntax Rules document |
| TopicId | Yes | String | Metric Topic ID -Obtain the log topic Id through Get Log Topic List. |
| Time | No | Integer | Query time, Unix timestamp in seconds. When empty, it represents the current timestamp. |
| Parameter Name | Type | Description |
|---|---|---|
| ResultType | String | Metric Query Result Type, Support -scalar value -string value -instantaneous vector -matrix interval vector |
| Result | String | Metric Query Result |
| RequestId | String | The unique request ID, generated by the server, will be returned for every request (if the request fails to reach the server for other reasons, the request will not obtain a RequestId). RequestId is required for locating a problem. |
POST / HTTP/1.1
Host: cls.intl.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: QueryMetric
<Common request parameters>
{
"TopicId": "8e7c3bd9-xxxx-xxxx-xxxx-207971e1f80f",
"Query": "access_evaluation_duration_bucket",
"Time": 1695197431
}
{
"Response": {
"RequestId": "1ee38aa1-xxxx-xxxx-xxxx-b1961a464c99",
"ResultType": "vector",
"Result": "[{\"metric\":{\"__name__\":\"access_evaluation_duration_bucket\",\"container\":\"grafana\",\"endpoint\":\"http\",\"instance\":\"172.17.0.6:3000\",\"job\":\"grafana\",\"le\":\"0.00064\",\"namespace\":\"monitoring\",\"pod\":\"grafana-6676ccf9c9-zjk62\",\"prometheus\":\"monitoring/k8s\",\"prometheus_replica\":\"prometheus-k8s-0\",\"service\":\"grafana\"},\"value\":[1695197431,\"5808\"]},{\"metric\":{\"__name__\":\"access_evaluation_duration_bucket\",\"container\":\"grafana\",\"endpoint\":\"http\",\"instance\":\"172.17.0.6:3000\",\"job\":\"grafana\",\"le\":\"0.01024\",\"namespace\":\"monitoring\",\"pod\":\"grafana-6676ccf9c9-zjk62\",\"prometheus\":\"monitoring/k8s\",\"prometheus_replica\":\"prometheus-k8s-0\",\"service\":\"grafana\"},\"value\":[1695197431,\"5808\"]},{\"metric\":{\"__name__\":\"access_evaluation_duration_bucket\",\"container\":\"grafana\",\"endpoint\":\"http\",\"instance\":\"172.17.0.6:3000\",\"job\":\"grafana\",\"le\":\"0.04096\",\"namespace\":\"monitoring\",\"pod\":\"grafana-6676ccf9c9-zjk62\",\"prometheus\":\"monitoring/k8s\",\"prometheus_replica\":\"prometheus-k8s-0\",\"service\":\"grafana\"},\"value\":[1695197431,\"5808\"]},{\"metric\":{\"__name__\":\"access_evaluation_duration_bucket\",\"container\":\"grafana\",\"endpoint\":\"http\",\"instance\":\"172.17.0.6:3000\",\"job\":\"grafana\",\"le\":\"0.65536\",\"namespace\":\"monitoring\",\"pod\":\"grafana-6676ccf9c9-zjk62\",\"prometheus\":\"monitoring/k8s\",\"prometheus_replica\":\"prometheus-k8s-0\",\"service\":\"grafana\"},\"value\":[1695197431,\"5808\"]},{\"metric\":{\"__name__\":\"access_evaluation_duration_bucket\",\"container\":\"grafana\",\"endpoint\":\"http\",\"instance\":\"172.17.0.6:3000\",\"job\":\"grafana\",\"le\":\"2.62144\",\"namespace\":\"monitoring\",\"pod\":\"grafana-6676ccf9c9-zjk62\",\"prometheus\":\"monitoring/k8s\",\"prometheus_replica\":\"prometheus-k8s-0\",\"service\":\"grafana\"},\"value\":[1695197431,\"5808\"]},{\"metric\":{\"__name__\":\"access_evaluation_duration_bucket\",\"container\":\"grafana\",\"endpoint\":\"http\",\"instance\":\"172.17.0.6:3000\",\"job\":\"grafana\",\"le\":\"0.00016\",\"namespace\":\"monitoring\",\"pod\":\"grafana-6676ccf9c9-zjk62\",\"prometheus\":\"monitoring/k8s\",\"prometheus_replica\":\"prometheus-k8s-0\",\"service\":\"grafana\"},\"value\":[1695197431,\"5805\"]},{\"metric\":{\"__name__\":\"access_evaluation_duration_bucket\",\"container\":\"grafana\",\"endpoint\":\"http\",\"instance\":\"172.17.0.6:3000\",\"job\":\"grafana\",\"le\":\"+Inf\",\"namespace\":\"monitoring\",\"pod\":\"grafana-6676ccf9c9-zjk62\",\"prometheus\":\"monitoring/k8s\",\"prometheus_replica\":\"prometheus-k8s-0\",\"service\":\"grafana\"},\"value\":[1695197431,\"5808\"]},{\"metric\":{\"__name__\":\"access_evaluation_duration_bucket\",\"container\":\"grafana\",\"endpoint\":\"http\",\"instance\":\"172.17.0.6:3000\",\"job\":\"grafana\",\"le\":\"0.00256\",\"namespace\":\"monitoring\",\"pod\":\"grafana-6676ccf9c9-zjk62\",\"prometheus\":\"monitoring/k8s\",\"prometheus_replica\":\"prometheus-k8s-0\",\"service\":\"grafana\"},\"value\":[1695197431,\"5808\"]},{\"metric\":{\"__name__\":\"access_evaluation_duration_bucket\",\"container\":\"grafana\",\"endpoint\":\"http\",\"instance\":\"172.17.0.6:3000\",\"job\":\"grafana\",\"le\":\"0.16384\",\"namespace\":\"monitoring\",\"pod\":\"grafana-6676ccf9c9-zjk62\",\"prometheus\":\"monitoring/k8s\",\"prometheus_replica\":\"prometheus-k8s-0\",\"service\":\"grafana\"},\"value\":[1695197431,\"5808\"]},{\"metric\":{\"__name__\":\"access_evaluation_duration_bucket\",\"container\":\"grafana\",\"endpoint\":\"http\",\"instance\":\"172.17.0.6:3000\",\"job\":\"grafana\",\"le\":\"1e-05\",\"namespace\":\"monitoring\",\"pod\":\"grafana-6676ccf9c9-zjk62\",\"prometheus\":\"monitoring/k8s\",\"prometheus_replica\":\"prometheus-k8s-0\",\"service\":\"grafana\"},\"value\":[1695197431,\"5593\"]},{\"metric\":{\"__name__\":\"access_evaluation_duration_bucket\",\"container\":\"grafana\",\"endpoint\":\"http\",\"instance\":\"172.17.0.6:3000\",\"job\":\"grafana\",\"le\":\"4e-05\",\"namespace\":\"monitoring\",\"pod\":\"grafana-6676ccf9c9-zjk62\",\"prometheus\":\"monitoring/k8s\",\"prometheus_replica\":\"prometheus-k8s-0\",\"service\":\"grafana\"},\"value\":[1695197431,\"5787\"]}]"
}
}
TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call APIs.
The following only lists the error codes related to the API business logic. For other error codes, see Common Error Codes.
| Error Code | Description |
|---|---|
| FailedOperation | Operation failed. |
| FailedOperation.QueryError | The query statement failed to run. |
| FailedOperation.Timeout | Operation timed out |
| InternalError | Internal error. |
| InternalError.SearchError | Retrieval error |
| InternalError.SearchFailed | Retrieval failed |
| InvalidParameter | Incorrect parameter. |
| MissingParameter | Missing parameter. |
| ResourceNotFound.TopicNotExist | The log topic does not exist. |
피드백