Get¶
GET /api/v1/service_manage/performance/get
Overview¶
Get the performance statistics of a service in the current workspace within a specified window.
Before you begin and usage steps¶
First obtain the service name from the Service Performance List and fill it in verbatim as serviceName. To make comparisons easier, use the same start and end for the statistics scope as you use for the list. This endpoint returns the first matching statistics entry; read content directly. When there is no data, content is an empty object. The service association status is queried synchronously.
Request headers¶
| Parameter | Type | Required | Description |
|---|---|---|---|
| DF-API-KEY | string | Y | OpenAPI authentication credential for the workspace. Example: <DF-API-KEY>How to obtain or fill in: Obtain an OpenAPI Key with the required permissions from the API Key management of the target workspace. |
Query request parameters¶
| Parameter | Type | Required | Description |
|---|---|---|---|
| start | integer | Y | Query start time, in Unix milliseconds. It is recommended to combine it with end to form the statistics window you actually need. Example: 1785427200000How to obtain or fill in: Take the query start moment from the console time picker or a business record and convert it to a Unix millisecond integer. Replace the example time with your own query window. |
| end | integer | Y | Query end time, in Unix milliseconds. Use the same time basis as start. Example: 1785430800000How to obtain or fill in: Take the Unix millisecond integer of the query end moment, for example the result of JavaScript Date.getTime(). |
| serviceName | string | Y | Service name. Distinguishes the name value from the service configuration UUID starting with sman_. Null allowed: False Empty string allowed: False Example: checkout-apiHow to obtain or fill in: Obtain the original service name from content.buckets[].service in the Service Performance List, or from the Service Configuration List. |
Additional parameter notes¶
Response time raw values are in microseconds, and error rate is a ratio from 0 to 1. The statistics content may vary with the collection dimensions.
Request example¶
curl --get 'https://openapi.guance.com/api/v1/service_manage/performance/get' \
-H 'DF-API-KEY: <DF-API-KEY>' \
--data-urlencode start=1785427200000 \
--data-urlencode end=1785430800000 \
--data-urlencode serviceName=checkout-api
Response¶
HTTP 200, application/json. The example below shows the main fields that can be read directly.
| Field | Type | Description |
|---|---|---|
| content.key | string | Grouped service name, usually the same as service. |
| content.service | string | Service name in the collected data, which is also the serviceName for single-service queries. |
| content.source_type | string | Collected service source type. |
| content.type | string | Compatibility field, the same as source_type. |
| content.version | string | Service version, returned when this statistics dimension exists. |
| content.env | string | Service environment, returned when this statistics dimension exists. |
| content.total_count | integer | Number of requests in the statistics window. |
| content.avg_per_second | number | Average requests per second, in req/s. |
| content.avg_resp_time | number | Average response time, in microseconds; divide by 1000 to convert to milliseconds. |
| content.sum_resp_time | number | Cumulative request response time, in microseconds. |
| content.max_duration | number | Longest request response time, in microseconds. |
| content.p50 | number | 50th percentile of response time, in microseconds. |
| content.p75 | number | 75th percentile of response time, in microseconds. |
| content.p90 | number | 90th percentile of response time, in microseconds. |
| content.p95 | number | 95th percentile of response time, in microseconds. |
| content.p99 | number | 99th percentile of response time, in microseconds. |
| content.error_count | integer | Number of error requests. |
| content.error_rate | number | Error rate, from 0 to 1; multiply by 100 to display as a percentage. |
| content.apdex | number or string | Apdex satisfaction score returned when provided by the backend. |
| content.serviceCatelog | object | Object converted from the TOML service configuration of a registered service. The spelling is kept as serviceCatelog; the structure is the same as the parsed structure of the serviceCatelog TOML string in Create Service Configuration; the creation parameter is still a TOML string, and field meanings and how to fill them in are described on that page. Empty object when the service is not registered. |
| content.serviceCatelog.Team.team | string | Name of the responsible team when the configuration exists. Other service configuration fields can be read together with the service configuration details. |
| content.checkerInfo | array<object> |
List of associated monitors. |
| content.checkerInfo[].name | string | Monitor name. |
| content.checkerInfo[].uuid | string | Monitor UUID. |
| content.checkerInfo[].type | string | Monitor type. |
| content.dfStatus | string | Current event status of the service, such as ok or critical; ok when there is no status record. |
| content.__docid | string | Event document ID corresponding to the service status; an empty string when there is no corresponding event. |
| content.isFavorite | integer or null | Favorite flag for the current calling identity. 0 or 1 for a registered service; may be null when there is no corresponding service configuration. |
| content.uuid | string | UUID of the registered service configuration. May be an empty string for an unregistered service. |
| content.language | string | Registered collection SDK language; may be empty when not registered. |
| content.declaration | object or null | Workspace common declarations attached in non-empty statistics results. |
{
"code": 200,
"content": {
"key": "checkout-api",
"service": "checkout-api",
"source_type": "web",
"type": "web",
"version": "1.0.0",
"env": "production",
"total_count": 1200,
"avg_per_second": 0.333333,
"avg_resp_time": 25000,
"sum_resp_time": 30000000,
"max_duration": 150000,
"p50": 18000,
"p75": 25000,
"p90": 45000,
"p95": 70000,
"p99": 120000,
"error_count": 12,
"error_rate": 0.01,
"serviceCatelog": {},
"checkerInfo": [],
"dfStatus": "ok",
"__docid": "",
"isFavorite": 0,
"uuid": "sman_example",
"language": "python",
"declaration": {}
},
"errorCode": "",
"message": "",
"success": true,
"traceId": "TRACE-EXAMPLE"
}
When there is no matching data
{
"code": 200,
"content": {},
"errorCode": "",
"message": "",
"success": true,
"traceId": "TRACE-EXAMPLE"
}
Error responses¶
For authentication, rate limiting, and common request errors, see Common Error Definitions.
When there is no matching trace data, the list returns empty buckets and the single-service query returns an empty object; a "service does not exist" error is usually not returned. Other 4xx query errors returned by the backend are returned with the actual errorCode and message.
| HTTP status | errorCode | Trigger condition | Message or response description | Handling |
|---|---|---|---|---|
| 406 | ft.ParameterValidationFailed | A request field is missing, or a field value violates the declared validation conditions | Parameter parsing failed | Check the parameter location, field name, type, and value. |
| 422 | ft.KodoAPMSummaryRowBudgetExceeded | The service statistics aggregation scan budget is exceeded | The APM service summary data volume exceeds the processing limit. Reduce the time range and retry. | Reduce the time window. Reducing pageSize does not lower the aggregation budget for all services. |
| 429 | ft.KodoServerOverloaded | The query service is overloaded or busy | The current request rate is too high. Try again later. | Retry with a backoff interval and reduce the number of concurrent queries. |
| 500 | ft.InternalServerError | The statistics service is unavailable, the connection timed out, or another internal query exception was not passed through | Internal error | Retry later or reduce the time window. If the failure persists, provide the traceId and request parameters. |
| 406 | ft.KodoRequestDeadlineExceeded | Query execution exceeds the time allowed by the backend | The data query timed out. This may be caused by the following: too much data, network latency, or excessive server load. You can resolve this issue in the following ways: 1. Add filter conditions or reduce the time range, then query again. 2. Wait a while and try the query again. |
Reduce the time window, verify serviceName, and retry; if the failure persists, provide the traceId. |
| 406 | ft.KodoTooManyRows | The query data volume exceeds the backend limit | The queried data volume exceeds the maximum limit. Add filter conditions or reduce the time range, then query again. | Reduce the time window, verify serviceName, and retry; if the failure persists, provide the traceId. |