Domain name for API request: monitor.intl.tencentcloudapi.com.
Prometheus internal read-only dynamic api proxy supports accessing native Prometheus APIs via cloud api format
support the following APIs:
| path | method | purpose |
|---|---|---|
| /api/v1/query | GET, POST | point query |
| /api/v1/query_range | GET, POST | Range query |
| /api/v1/series | GET, POST | Query the series list |
| /api/v1/labels | GET, POST | Query labels |
| /api/v1/label/{label_name}/values | GET | Query label values. |
| /api/v1/rules | GET | Query pre-aggregation and alert rules. |
| /api/v1/user_limits | GET | Query prometheus instance limits |
| /alertmanager/api/v2/alerts/groups | GET | Query current alarm information |
| /alertmanager/api/v2/silences | GET | Query alert silences |
| /alertmanager/api/v2/silence/{id} | GET | Query alert silence details |
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: ExportPrometheusReadOnlyDynamicAPI. |
| Version | Yes | String | Common Params. The value used for this API: 2018-07-24. |
| Region | Yes | String | Common Params. For more information, please see the list of regions supported by the product. This API only supports: ap-bangkok, ap-beijing, ap-chengdu, ap-chongqing, ap-guangzhou, ap-hongkong, ap-jakarta, ap-nanjing, ap-seoul, ap-shanghai, ap-shanghai-fsi, ap-shenzhen-fsi, ap-singapore, ap-tokyo, eu-frankfurt, na-ashburn, na-siliconvalley, sa-saopaulo. |
| InstanceId | Yes | String | Prometheus Instance ID |
| Method | Yes | String | HTTP method name GET/POST/PUT/DELETE |
| Path | Yes | String | HTTP path (including query string) |
| RequestBody | No | String | HTTP request body, any data |
| Headers.N | No | Array of PrometheusStringKeyValuePair | HTTP headers |
| SelfMonitor | No | Boolean | Whether to request self-monitoring data. Self-monitoring is only supported for the /api/v1/query and /api/v1/query_range APIs. |
| Parameter Name | Type | Description |
|---|---|---|
| HTTP | PrometheusDynamicAPIResponseHTTP | HTTP response data |
| 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. |
Path: api/v1/query
Method: GET POST
Query parameter
1. query = <string> prometheus query expression
2. time = <rfc3339 | unix_timestamp> The time when querying data
3. timeout = <duration> (1m / 5s / ...)
response body
{
"status": "success" | "error",
"data": {
"resultType": "matrix" | "vector" | "scalar" | "string",
"result": <value>
},
return on error
"errorType": "<string>",
"error": "<string>",
warning message
"warnings": ["<string>"]
}
Refer to the result field in the query result for the Prometheus instant query result encoding.
POST / HTTP/1.1
Host: monitor.intl.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: ExportPrometheusReadOnlyDynamicAPI
<Common request parameters>
{
"InstanceId": "prom-xz223asd",
"Method": "GET",
"Path": "/api/v1/query?query=ALERTS{}&time=1700534157&timeout=30s"
}
{
"Response": {
"HTTP": {
"StatusCode": 200,
"ResponseBody": "{\"status\":\"success\",\"data\":{\"resultType\":\"vector\",\"result\":[{\"metric\":{\"__name__\":\"ALERTS\",\"_appid_\":\"1251763868\",\"_instanceid_\":\"prom-7031abs0\",\"_language_\":\"zh-CN\",\"_policyname_\":\"alertgroup-in-tke/alert-2\",\"_region_\":\"ap-chongqing\",\"_regionid_\":\"19\",\"_subaccountuin_\":\"4611686018429437801\",\"_uin_\":\"1500000688\",\"alertname\":\"alertgroup-in-tke/alert-2\",\"alertstate\":\"firing\",\"severity\":\"warning\",\"tcloud_region_id\":\"19\",\"tcloud_region_name\":\"ap-chongqing\"},\"value\":[1700534157,\"1\"]},{\"metric\":{\"__name__\":\"ALERTS\",\"_appid_\":\"1251763868\",\"_instanceid_\":\"prom-7031abs0\",\"_interval_\":\"5m\",\"_language_\":\"zh-CN\",\"_policyid_\":\"arule-2wou7mfi\",\"_policyname_\":\"test-monitor-alert\",\"_region_\":\"ap-chongqing\",\"_regionid_\":\"19\",\"_subaccountuin_\":\"100026263254\",\"_uin_\":\"1500000688\",\"alertname\":\"test-monitor-alert\",\"alertstate\":\"firing\",\"tcloud_region_id\":\"19\",\"tcloud_region_name\":\"ap-chongqing\"},\"value\":[1700534157,\"1\"]},{\"metric\":{\"__name__\":\"ALERTS\",\"_appid_\":\"1251763868\",\"_instanceid_\":\"prom-7031abs0\",\"_language_\":\"zh-CN\",\"_policyname_\":\"al-test-changed/aaaaa\",\"_region_\":\"ap-chongqing\",\"_regionid_\":\"19\",\"_subaccountuin_\":\"100026263254\",\"_uin_\":\"1500000688\",\"alertname\":\"al-test-changed/aaaaa\",\"alertstate\":\"firing\",\"tcloud_region_id\":\"19\",\"tcloud_region_name\":\"ap-chongqing\"},\"value\":[1700534157,\"1\"]},{\"metric\":{\"__name__\":\"ALERTS\",\"_appid_\":\"1251763868\",\"_instanceid_\":\"prom-7031abs0\",\"_language_\":\"zh-CN\",\"_policyname_\":\"alertgroup-in-tke/alert-1\",\"_region_\":\"ap-chongqing\",\"_regionid_\":\"19\",\"_subaccountuin_\":\"4611686018429437801\",\"_uin_\":\"1500000688\",\"alertname\":\"alertgroup-in-tke/alert-1\",\"alertstate\":\"firing\",\"severity\":\"warning\",\"tcloud_region_id\":\"19\",\"tcloud_region_name\":\"ap-chongqing\"},\"value\":[1700534157,\"1\"]}]}}"
},
"RequestId": "8-ztbsc3gc2-rw6lzn4gfg5kuz6khrxg"
}
}
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 |
|---|---|
| AuthFailure | Error with CAM signature/authentication. |
| AuthFailure.AccessCAMFail | Access authentication failed. |
| AuthFailure.UnauthorizedOperation | The request is not authorized. For more information on the authentication, see the CAM documentation. |
| FailedOperation | Operation failed. |
| FailedOperation.DataColumnNotFound | The data table field doesn't exist. |
| FailedOperation.DataQueryFailed | Failed to query the data. |
| FailedOperation.DataTableNotFound | The data table doesn't exist. |
| FailedOperation.DbQueryFailed | Failed to query the database. |
| FailedOperation.DbRecordCreateFailed | Failed to create the database record. |
| FailedOperation.DbRecordDeleteFailed | Failed to delete the database record. |
| FailedOperation.DbRecordUpdateFailed | Failed to update the database record. |
| FailedOperation.DbTransactionBeginFailed | Failed to start the database transaction. |
| FailedOperation.DbTransactionCommitFailed | Failed to submit the database transaction. |
| FailedOperation.InstanceNotFound | The instance does not exist. |
| FailedOperation.InternalError | Internal service error. |
| FailedOperation.ResourceNotFound | The resource does not exist. |
| InternalError | Internal error. |
| InvalidParameter | Invalid parameter. |
| InvalidParameter.InvalidAppId | Invalid AppId. |
| InvalidParameter.InvalidParameter | Invalid parameter. |
| InvalidParameter.InvalidParameterParam | Invalid parameter. |
| InvalidParameter.ParamError | Incorrect parameter. |
| InvalidParameterValue | The parameter value is incorrect. |
| LimitExceeded | Quota limit is reached. |
| MissingParameter | Missing parameter. |
| RequestLimitExceeded | The number of requests exceeds the frequency limit. |
| ResourceNotFound | The resource is not found. |
| ResourceUnavailable | The resource is unavailable. |
| ResourcesSoldOut | The resources have been sold out. |
| UnauthorizedOperation | Unauthorized operation. |
| UnknownParameter | Unknown parameter. |
| UnsupportedOperation | Unsupported operation. |
文档反馈