List APM Services¶
GET /api/v1/tracing/list
Overview¶
List APM service statistics for a workspace within a specified time window with pagination, and supplement them with the registered Service List and monitoring statuses.
Prerequisites and Usage Steps¶
Use site-level External credentials with r or w permissions. For authentication, see External API Signature Authentication. First obtain an active workspaceUUID and a real millisecond window; this endpoint handles one workspace at a time. For multiple workspaces, request them one by one using the same window. The defaults are pageIndex=1 and pageSize=50 (1 to 100), sorted by p99 in descending order. An explicit order only uses the first sort object. Read content.buckets and content.pageInfo; max_* are comparison upper bounds for all services in the same time window. Even after adding filters/serviceTypes, the denominator is not recalculated. Statistics may be empty when no index exists; do not treat failures as empty data. External has no personal creator, so favorite fields do not represent the caller's personal favorites. loading=true indicates that the additional status cache for registered services is still loading; you can query again later. Read requests may enqueue status refresh jobs; dfStatus=ok/empty checkerInfo cannot replace complete alert validation. The service registration uuid is different from the service name service; raw performance duration values are in microseconds, so divide by 1000 to convert to milliseconds. This endpoint does not export CSV files.
Request Headers¶
| Parameter | Type | Required | Description |
|---|---|---|---|
| X-Df-SVersion | string | Signature version for the original path and request body; you cannot omit it and continue using the algorithm on this page. Example: v20240417How to obtain or fill in: This page's example uses this fixed version, which matches the example signature algorithm. |
|
| X-Df-Access-Key | string | Y | Read endpoints can use r or w credentials; write endpoints require w credentials. Example: <external-access-key>How to obtain or fill in: Assigned by the site administrator as an External API AK; do not use a workspace OpenAPI Key. |
| X-Df-Signature | string | Y | Concatenate the uppercase method, nonce, original full path, timestamp, and original UTF-8 request body with spaces, then compute HMAC-SHA256 and take the hex digest. Example: <hmac-sha256-hex>How to obtain or fill in: Compute with the matching SK according to External API Signature Authentication; see the complete runnable template below. |
| X-Df-Timestamp | string | Y | Must be within the signature validity window configured for the site; do not reuse the example time. Example: 1785427200How to obtain or fill in: When sending, use str(int(time.time())) to generate the current Unix seconds string. |
| X-Df-Nonce | string | Y | Temporary serial number; when resending after a failure, also generate a new value and recompute the signature. Example: 97d275ee9f774315a7885ba7347acbd9How to obtain or fill in: Regenerate uuid.uuid4().hex for each request. |
Query Request Parameters¶
| Parameter | Type | Required | Description |
|---|---|---|---|
| filters.tags | array | List of conditions in the form of an object containing tags; you can also use this array directly as the root of the filters JSON. Example: [{"name": "service", "operation": "in", "value": ["checkout-api"], "condition": "and"}]How to obtain or fill in: Construct from real APM tags and verified query conditions; this path represents the structure after decoding the filters string. |
|
| filters.tags[*] | json | Leaf condition or recursive group object containing filters. Example: {"name": "service", "operation": "in", "value": ["checkout-api"], "condition": "and"}How to obtain or fill in: Construct from real APM tags and verified query conditions; this path represents the structure after decoding the filters string. |
|
| filters.tags[*].name | string | Leaf field name, obtained from actual collected tags; required and non-empty. Example: serviceHow to obtain or fill in: Construct from real APM tags and verified query conditions; this path represents the structure after decoding the filters string. |
|
| filters.tags[*].operation | string | Leaf operator; common values include =, !=, in, notin, =~, wildcard, exists, etc.; choose based on downstream support. The compatible op can be used; omitting both causes an internal error. Example: inHow to obtain or fill in: Construct from real APM tags and verified query conditions; this path represents the structure after decoding the filters string. |
|
| filters.tags[*].value | array | Array of leaf match values, filled in according to the actual field type; required, and an empty array is not treated as a wildcard. Example: ["checkout-api"]How to obtain or fill in: Construct from real APM tags and verified query conditions; this path represents the structure after decoding the filters string. |
|
| filters.tags[*].condition | string | Logic with the preceding item, and/or, default and; the compatible logic can be used. Example: andHow to obtain or fill in: Construct from real APM tags and verified query conditions; this path represents the structure after decoding the filters string. |
|
| filters.tags[*].filters | array | Array of grouped subconditions; the recursive structure is the same as the outer level; non-empty groups are joined by condition. Example: [{"name": "service", "operation": "in", "value": ["checkout-api"], "condition": "and"}]How to obtain or fill in: Construct from real APM tags and verified query conditions; this path represents the structure after decoding the filters string. |
|
| workspaceUUID | string | Y | Required single workspace UUID; * or comma-separated multiple UUIDs are not supported. External on this site is a site-level credential; the target workspace is not determined by a regular member OpenAPI Key. Example: wksp_example001How to obtain or fill in: Obtain the active workspace from Workspace List content.data[].uuid. |
| start | integer | Y | Required start time in milliseconds as an integer; must be less than end; the signature timestamp separately uses the current Unix seconds. Example: 1785427200000How to obtain or fill in: Convert the start of the actual collected data window to Unix milliseconds, for example with JavaScript Date.getTime(). |
| end | integer | Y | Required end time in milliseconds as an integer; the window should contain real trace collection data. Example: 1785430800000How to obtain or fill in: Use the end of the actual window in Unix milliseconds on the same time basis. |
| filters | json | Optional JSON string; can be an object containing a tags array or an array of condition objects. Omit to apply no filtering; [] means empty conditions; do not pass only a fields object or {}, because the current normalization may still leave an object and not treat it as a condition array. operation/op and condition/logic are compatible. Invalid JSON/object structures may cause 500; this is not the request JSON body. Example: {"tags":[{"name":"service","operation":"in","value":["checkout-api"],"condition":"and"}]}How to obtain or fill in: Select real fields and values such as service, env, and version from collected APM service/tag results; URL-encode the entire JSON string. |
|
| serviceTypes | array | Optional JSON array string; filters services by source_type; omit to apply no filtering. It is not a comma-separated string, and do not pass parameters with the same name repeatedly; invalid JSON or non-array values may cause downstream/internal failures. Example: ["web","db"]How to obtain or fill in: Read the actual type from the Service List content.buckets[].source_type/type, then serialize it as an array of strings. |
|
| order | string | Optional sorting JSON array string; defaults to p99 descending; currently only the first object in the array is read. Common keys include key, total_count, avg_resp_time, avg_per_second, error_count, error_rate, sum_resp_time, max_duration, p50/p75/p90/p95/p99; direction is asc/desc. Invalid JSON, an empty array, or an incorrect structure may cause 500, with no automatic fallback. Example: [{"p99":"desc"}]How to obtain or fill in: Select one from the allowed fields and choose asc or desc as needed. Pass a single-element JSON array string. |
|
| pageIndex | integer | Page number, default 1. Allows null: False $minValue: 1 Example: 1How to obtain or fill in: Start from 1; subsequent requests increment the page number while keeping filters and the time window consistent. |
|
| pageSize | integer | Number per page, default 50. Allows null: False $minValue: 1 $maxValue: 100 Example: 50How to obtain or fill in: Enter an integer from 1 to 100 as needed. |
Additional Parameter Notes¶
The JSON filter string uses full URL encoding and is included in the signature; a normal empty result may have content.buckets=[], pageInfo.totalCount=0, and loading=false, and max_* keys may be omitted. Service List configuration fields and actual collected statistics are not the same resource.
Request Example¶
import hashlib
import hmac
import json
import time
import uuid
from urllib.parse import urlencode
from urllib.request import Request, urlopen
from urllib.error import HTTPError, URLError
# Replace with the target site address and the External API AK/SK assigned by the administrator.
server = "https://external-api.guance.com"
access_key = "<external-access-key>"
secret_key = "<external-secret-key>"
method = 'GET'
path = '/api/v1/tracing/list'
query = {'workspaceUUID': 'wksp_example001', 'start': 1785427200000, 'end': 1785430800000, 'pageIndex': 1, 'pageSize': 50}
data = None
full_path = path + ("?" + urlencode(query) if query else "")
body = "" if data is None else json.dumps(data, ensure_ascii=False, separators=(",", ":"))
timestamp = str(int(time.time()))
nonce = uuid.uuid4().hex
string_to_sign = " ".join([method, nonce, full_path, timestamp, body])
signature = hmac.new(secret_key.encode("utf-8"), string_to_sign.encode("utf-8"), hashlib.sha256).hexdigest()
headers = {
"X-Df-Access-Key": access_key,
"X-Df-Timestamp": timestamp,
"X-Df-Nonce": nonce,
"X-Df-Signature": signature,
"X-Df-SVersion": "v20240417",
}
if data is not None:
headers["Content-Type"] = "application/json"
request = Request(server + full_path, data=None if data is None else body.encode("utf-8"), headers=headers, method=method)
try:
with urlopen(request, timeout=30) as result:
payload = json.loads(result.read().decode("utf-8"))
except HTTPError as error:
print("HTTP", error.code, error.read().decode("utf-8")) # Determine based on errorCode, content, and traceId; do not output the AK/SK.
raise SystemExit(1)
except (URLError, TimeoutError):
print('读取失败,可以退避后重新签名重试;保留traceId与查询条件。')
raise SystemExit(1)
print(json.dumps(payload, ensure_ascii=False, indent=2))
Response¶
HTTP 200, standard External envelope in application/json, with data in content; this module does not automatically add an OpenAPI declaration, nor does it promote content.pageInfo to the top level. Response statistics fields vary with the actual downstream version/data.
| Field | Type | Description |
|---|---|---|
| content.max_duration | number | Upper limit of the longest response duration across all services, in microseconds. |
| content.max_total_count | integer | Largest total request count among all services. |
| content.max_per_second | number | Largest requests per second among all services, req/s. |
| content.max_avg_duration | number | Largest average response duration among all services, in microseconds. |
| content.max_sum_duration | number | Largest cumulative response duration among all services, in microseconds. |
| content.max_p50 | number | Largest P50 response duration among all services, in microseconds. |
| content.max_p75 | number | Largest P75 response duration among all services, in microseconds. |
| content.max_p90 | number | Largest P90 response duration among all services, in microseconds. |
| content.max_p95 | number | Largest P95 response duration among all services, in microseconds. |
| content.max_p99 | number | Largest P99 response duration among all services, in microseconds. |
| content.buckets | array<object> |
Service statistics for the current page. Statistical fields are provided based on available data. |
| content.buckets[].key | string | Grouped service name, usually the same as service. |
| content.buckets[].service | string | Service name in collected data; also the serviceName for single-service queries. |
| content.buckets[].source_type | string | Collected service source type. |
| content.buckets[].type | string | Compatibility field, same as source_type. |
| content.buckets[].version | string | Service version; returned when this statistical dimension exists. |
| content.buckets[].env | string | Service environment; returned when this statistical dimension exists. |
| content.buckets[].total_count | integer | Number of requests in the statistical window. |
| content.buckets[].avg_per_second | number | Average requests per second, in req/s. |
| content.buckets[].avg_resp_time | number | Average response time, in microseconds; divide by 1000 to convert to milliseconds. |
| content.buckets[].sum_resp_time | number | Cumulative request response duration, in microseconds. |
| content.buckets[].max_duration | number | Longest request response duration, in microseconds. |
| content.buckets[].p50 | number | 50th percentile of response time, in microseconds. |
| content.buckets[].p75 | number | 75th percentile of response time, in microseconds. |
| content.buckets[].p90 | number | 90th percentile of response time, in microseconds. |
| content.buckets[].p95 | number | 95th percentile of response time, in microseconds. |
| content.buckets[].p99 | number | 99th percentile of response time, in microseconds. |
| content.buckets[].error_count | integer | Number of error requests. |
| content.buckets[].error_rate | number | Error rate, from 0 to 1; multiply by 100 to display as a percentage. |
| content.buckets[].apdex | number or string | Apdex satisfaction score returned when provided by the backend. |
| content.buckets[].serviceCatelog | object | Parsed TOML configuration object for the corresponding registered service; {} if there is no configuration; the current trace list does not provide originStr switching. Custom/historical keys not listed are returned according to the original configuration. |
| content.buckets[].checkerInfo | array<object> |
List of associated Monitors. |
| content.buckets[].checkerInfo[].name | string | Monitor name. |
| content.buckets[].checkerInfo[].uuid | string | Monitor UUID. |
| content.buckets[].checkerInfo[].type | string | Monitor type. |
| content.buckets[].dfStatus | string | Current event status of the service, such as ok or critical; ok when there is no status record. |
| content.buckets[].__docid | string | Event document ID corresponding to the service status; an empty string when there is no corresponding event. |
| content.buckets[].isFavorite | integer or null | Favorite flag 0/1 or null; External does not pass a personal creator, so it cannot represent the favorite status of any real account. |
| content.buckets[].uuid | string | UUID of the registered service configuration. Can be an empty string for unregistered services. |
| content.buckets[].language | string | Registered collection SDK language; can be empty when unregistered. |
| content.pageInfo | object | Pagination information is located within content. |
| content.pageInfo.pageIndex | integer | Current page number. |
| content.pageInfo.pageSize | integer | Number per page. |
| content.pageInfo.count | integer | Actual number on the current page. |
| content.pageInfo.totalCount | integer | Total number of matching services. |
| content.loading | boolean | Whether additional status is still being loaded asynchronously. |
| content.buckets[].serviceCatelog.Team | object | Service and team configuration. |
| content.buckets[].serviceCatelog.Team.service | string | Service name. |
| content.buckets[].serviceCatelog.Team.type | string | Service category; invalid categories are handled according to the API rules when written. |
| content.buckets[].serviceCatelog.Team.colour | string | Service display color. |
| content.buckets[].serviceCatelog.Team.team | string | Name of the team to which the service belongs. |
| content.buckets[].serviceCatelog.Team.oncall | array<object> |
Contact methods. |
| content.buckets[].serviceCatelog.Team.oncall[].name | string | Contact method display name. |
| content.buckets[].serviceCatelog.Team.oncall[].type | string | email, mobile, or slack. |
| content.buckets[].serviceCatelog.Team.oncall[].emails | array<string> |
Email addresses for the email contact method. |
| content.buckets[].serviceCatelog.Team.oncall[].mobiles | array<string> |
Phone numbers for the mobile contact method. |
| content.buckets[].serviceCatelog.Team.oncall[].slack | string | Slack channel URL. |
| content.buckets[].serviceCatelog.Repos | array<object> |
List of code repositories. |
| content.buckets[].serviceCatelog.Repos[].name | string | Repository display name. |
| content.buckets[].serviceCatelog.Repos[].link | string | Repository URL. |
| content.buckets[].serviceCatelog.Repos[].provider | string | Provider display name. |
| content.buckets[].serviceCatelog.Docs | array<object> |
Operation document list. |
| content.buckets[].serviceCatelog.Docs[].name | string | Document display name. |
| content.buckets[].serviceCatelog.Docs[].link | string | Document URL. |
| content.buckets[].serviceCatelog.Docs[].provider | string | Document provider display name. |
| content.buckets[].serviceCatelog.Related | object | Associated applications, built-in views, and scenario tags. |
| content.buckets[].serviceCatelog.Related.AppId | string | Real User Monitoring (RUM) application ID; can be empty. |
| content.buckets[].serviceCatelog.Related.DashboardUUIDs | array<string> |
Associated built-in view UUIDs. |
| content.buckets[].serviceCatelog.Related.Tags | array<string> |
Scenario tag names. |
| content.buckets[].serviceCatelog.Other configuration keys | JSON value | Other historical/extended content supported by the original TOML; not limited to the example field set. |
{
"code": 200,
"content": {
"max_total_count": 250,
"max_per_second": 0.07,
"max_avg_duration": 12000,
"max_duration": 50000,
"buckets": [
{
"key": "checkout-api",
"service": "checkout-api",
"source_type": "web",
"type": "web",
"version": "",
"env": "",
"total_count": 250,
"avg_per_second": 0.06944444444444445,
"avg_resp_time": 12000,
"sum_resp_time": 3000000,
"max_duration": 50000,
"p50": 10000,
"p75": 14000,
"p90": 22000,
"p95": 30000,
"p99": 45000,
"error_count": 2,
"error_rate": 0.008,
"apdex": 0.98,
"serviceCatelog": {},
"checkerInfo": [],
"dfStatus": "ok",
"__docid": "",
"isFavorite": null,
"uuid": "",
"language": ""
}
],
"pageInfo": {
"pageIndex": 1,
"pageSize": 50,
"count": 1,
"totalCount": 1
},
"loading": false
},
"errorCode": "",
"message": "",
"success": true,
"traceId": "TRACE-EXAMPLE"
}
Error Responses¶
For authentication, rate limiting, and common request errors, see Common Error Definitions.
| HTTP Status | errorCode | Trigger Condition | Message or Response Description | Handling |
|---|---|---|---|---|
| 406 | ft.ParameterValidationFailed | Request field is missing, or the field value violates the declared validation conditions | Parameter parsing failed | Check the parameter location, field name, type, and value. |
| 422 | ft.KodoAPMSummaryRowBudgetExceeded | Service statistics aggregation scan budget exceeded | The APM service summary data volume exceeds the processing limit. Narrow the time range and try again. | Narrow the time window. Reducing pageSize does not lower the aggregation budget for all services. |
| 429 | ft.KodoServerOverloaded | Query service 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 | Invalid filters/serviceTypes/order format, failure to parse the Service List TOML, failure to enqueue a cache refresh, or statistics downstream unavailable/ordinary 5xx | Internal error | Use JSON strings and valid configurations as shown in the examples; retain the traceId, first narrow the time window, and then retry a limited number of times. Reads may trigger service status cache refresh jobs but do not modify the Service List. |
| 406 | ft.KodoRequestDeadlineExceeded | Query execution exceeds the time allowed by the backend | Data query timed out, possibly due to the following reasons: too much data, network latency, or high server load. You can resolve this issue in the following ways: 1. Add filter conditions or narrow the time range, and then query again. 2. Wait for a while and then try the query again. |
Narrow the time range, add filter conditions, and retry. |
| 406 | ft.KodoTooManyRows | Queried data volume exceeds the backend limit | The queried data volume exceeds the maximum limit. Add filter conditions or reduce the time range, and then query again. | Narrow the time range or reduce matching services, and retry. |
| 406 | ft.KodoInvalidRegexPattern | The regular expression filter expression used is invalid | The provided regular expression pattern is invalid | Correct the regular expression, or use an explicit set of service names. |