Domain name for API request: apm.intl.tencentcloudapi.com.
This API is used to create metric match rules between apm Business System and Prometheus Instance.
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: CreateApmPrometheusRule. |
| Version | Yes | String | Common Params. The value used for this API: 2021-06-22. |
| Region | Yes | String | Common Params. For more information, please see the list of regions supported by the product. |
| Name | Yes | String | Metric match rule name. |
| ServiceName | Yes | String | Applications where the rule takes effect. input an empty string for all applications. |
| MetricMatchType | Yes | Integer | Match type: 0 - precision match, 1 - prefix match, 2 - suffix match. |
| MetricNameRule | Yes | String | Specifies the rule for customer-defined metric names with cache hit. |
| InstanceId | Yes | String | Business system ID |
| Parameter Name | Type | Description |
|---|---|---|
| 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. |
This example shows you how to create a match rule for metrics between the apm Business System and Prometheus Instance.
POST / HTTP/1.1
Host: apm.intl.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: CreateApmPrometheusRule
<Common request parameters>
{
"Name": "MyRuleTest",
"ServiceName": "java-market-service",
"MetricMatchType": 1,
"MetricNameRule": "task.duration",
"InstanceId": "apm-059oXBfTL"
}{
"Response": {
"RequestId": "72159d4a-265c-43e8-b653-c62358f1e17b"
}
}
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.PromRuleConflict | Prometheus metric match rule conflict, same metric match rule exists. |
| FailedOperation.PromRuleIsEmptyErr | Prometheus metric match rule is empty. |
| FailedOperation.PromRuleNameConflict | Prometheus metric match rule name already exists. |
| FailedOperation.PromRuleRequestNotValidError | Prometheus metric match rule request error. |
Feedback