Reporting Service Metrics
Function
This API is used to report service metrics to the dashboard.
URI
POST /v2/{project_id}/csemonitor/metric
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| project_id | Yes | String | Unique ID of a tenant sub-project. Length: 1–64 characters. |
Request Parameters
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| x-domain-name | Yes | String | Tenant account name. |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| name | No | String | Name. |
| appId | No | String | Application ID. |
| serviceId | No | String | Service ID. |
| version | No | String | Version. |
| instanceId | No | String | Instance ID. |
| instance | No | String | Instance information. |
| thread | No | String | Thread name. |
| cpu | No | String | CPU information. |
| memory | No | String | Memory information. |
| interfaces | No | Array of FunctionMetricInfo objects | Monitoring item list information. |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| functionName | No | String | Name of the monitoring item. |
| functionType | No | String | Type of the monitoring item. |
| desc | No | String | Description of the monitoring item. |
| time | No | Long | Time. |
| appId | No | String | Application ID. |
| version | No | String | Version. |
| qps | No | Double | Throughput. |
| latency | No | Double | Latency. |
| rate | No | Double | Proportion. |
| failureRate | No | Double | Failure proportion. |
| shortCircuited | No | Integer | Number of circuit breakers. |
| semaphoreRejected | No | Integer | Number of rejected semaphores. |
| threadPoolRejected | No | Integer | Number of tasks rejected by the thread pool. |
| countTimeout | No | Integer | Timeout duration. |
| l995 | No | Double | 99.5% requests have a value smaller than the value of this parameter. |
| l99 | No | Double | 99% requests have a value smaller than the value of this parameter. |
| l90 | No | Double | 90% requests have a value smaller than the value of this parameter. |
| l75 | No | Double | 75% requests have a value smaller than the value of this parameter. |
| l50 | No | Double | 50% requests have a value smaller than the value of this parameter. |
| l25 | No | Double | 25% requests have a value smaller than the value of this parameter. |
| l5 | No | Double | 5% requests have a value smaller than the value of this parameter. |
Response Parameters
Status code: 400
| Parameter | Type | Description |
|---|---|---|
| errorCode | String | Error code. |
| errorMessage | String | Error information. |
| detail | String | Location details. |
Status code: 500
| Parameter | Type | Description |
|---|---|---|
| errorCode | String | Error code. |
| errorMessage | String | Error information. |
| detail | String | Location details. |
Example Requests
POST https://{endpoint}/v2/{project_id}/csemonitor/metric
{
"name" : "string",
"appId" : "string",
"version" : "string",
"serviceId" : "string",
"instance" : "string",
"instanceId" : "string",
"thread" : "string",
"cpu" : "string",
"memory" : "string",
"interfaces" : [ {
"time" : 0,
"name" : "string",
"qps" : 0,
"latency" : 0,
"rate" : 0,
"total" : 0,
"isCircuitBreakerOpen" : true,
"failure" : 0,
"shortCircuited" : 0,
"semaphoreRejected" : 0,
"threadPoolRejected" : 0,
"countTimeout" : 0,
"l995" : 0,
"l99" : 0,
"l90" : 0,
"l75" : 0,
"l50" : 0,
"l25" : 0,
"l5" : 0
} ]
} Example Responses
None
Status Codes
| Status Code | Description |
|---|---|
| 200 | OK |
| 400 | Bad Request |
| 500 | Internal Server Error |
Error Codes
See Error Codes.
Last Article: Dashboard
Next Article: Permissions Policies and Supported Actions
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.