Get Single Metric Details
API Description
Use this API to query the details of a metric.
API URL
GET Http://{anymetrics_host:anymetrics_port}/anymetrics/api/v1/metrics/detail
For how to obtain anymetrics_host:anymetrics_port, see Calling APIs.
Request Parameters
Common Request Parameters (HEADERS)
| Parameter | Type | Required | Description |
|---|---|---|---|
| tenant-id | String | Yes | The tenant ID for the tenant that contains the metric query content. |
| auth-type | String | Yes | Authentication method. Supported values: UID, TOKEN, ACCOUNT, APIKEY. |
| auth-value | String | Yes | Authentication value that corresponds to auth-type. |
| queryBy | String | No | Set to UUID to query metric details by metric code. |
How to Obtain Common Parameters
To obtain tenant-id, select the metric application from the top navigation bar in Aloudata CAN, choose API Integration from the left navigation menu, and copy it from the API Integration page. Set auth-value based on the selected auth-type.

Request Parameters
| Parameter | Type | Required | Maximum Length | Description |
|---|---|---|---|---|
| metricName | String | Yes | 128 | Metric name. |
Response Parameters
Response Parameter Description
| Parameter | Type | Required | Maximum Length | Description |
|---|---|---|---|---|
| code | String | Yes | 64 | API response code. |
| message | String | Yes | 512 | Message body. |
| traceId | String | Yes | 128 | Trace ID. |
| data | Array[Object] | Yes | Response result. For details, see "data Parameter Description". |
data Parameter Description
| Parameter | Type | Required | Maximum Length | Description | |
|---|---|---|---|---|---|
| code | String | No | Unique metric identifier generated by the system. | ||
| metricName | String | Yes | 128 | Metric name. | |
| version | Int | No | Metric version. | ||
| metricCode | String | No | Metric code. | ||
| type | String | Yes | Metric type. | ||
| metricDisplayName | String | Yes | Metric display name. | ||
| businessCaliber | String | No | Metric business definition. | ||
| caliber | Array | Yes | Metric calculation definition. | ||
| owner | String | No | Metric owner name. | ||
| businessOwner | String | No | Metric business owner name. | ||
| unit | String | No | Metric unit. For details, see "Metric Unit Description". | ||
| cnUnit | String | No | Chinese metric unit. For details, see "Metric Unit Description". | ||
| metricCategoryId | String | No | Metric category ID. | ||
| basicAttributes | Map |
No | Basic attributes. | ||
| businessAttributes | Map |
No | Business attributes. | ||
| technicalAttributes | Map |
No | Technical attributes. | ||
| managementAttributes | Map |
No | Management attributes. | ||
| metricViewCount | Integer | Yes | Number of metric queries. | ||
| viewDetailCount | Integer | Yes | Metric detail views. | ||
| status | String | Yes | Final metric status. Enum values: ONLINE: online; OFFLINE: offline. |
||
| publishStatus | String | Yes | Publishing status. Enum values: DRAFT: draft; PUBLISHED: published. |
||
| displayStatus | String | No | Current metric status. Enum values: UNPUBLISHED: unpublished; PUBLISHED: published; SAVED_NOT_PUBLISHED: saved but not published; OFFLINE: offline; PENDING_PUBLISH: publishing; PENDING_OFFLINE: taking offline; PENDING_DELETE: pending deletion. |
||
| gmtCreate | String | No | Creation time of the metric. | ||
| gmtUpdate | String | No | Update time of the metric. |
Metric Unit Description
| Category | Enum Value | Description |
|---|---|---|
| Currency | CNY_FEN | Fen (CNY) |
| CNY_YUAN | Yuan (CNY) | |
| CNY_WAN | Ten thousand yuan (CNY) | |
| CNY_BAI_WAN | Million yuan (CNY) | |
| CNY_YI_YUAN | Hundred million yuan (CNY) | |
| USD_CENT | Cent (USD) | |
| USD_DOLLAR | Dollar (USD) | |
| EUR_EURO | Euro (EUR) | |
| HKD_DOLLAR | Dollar (HKD) | |
| NEW_TAIWAN_DOLLAR | Dollar (TWD) | |
| Time | DAY | Day |
| MONTH | Month | |
| WEEK | Week | |
| YEAR | Year | |
| HOUR | Hour | |
| MINUTE | Minute | |
| SECOND | Second | |
| QUARTER | Quarter | |
| MILLISECOND | Millisecond | |
| Ratio | DECIMAL | Decimal |
| PERCENTAGE | Percentage | |
| PERMILLE | Per mille | |
| Noun | RANK | Rank |
| Object Count | HOUSEHOLD | Household |
| TRANSACTION | Transaction | |
| ITEM | Item | |
| INDIVIDUAL | Individual | |
| OCCURRENCE | Occurrence | |
| PERSON_DAY | Person-day | |
| FAMILY | Family | |
| HAND | Hand | |
| SHEET | Sheet | |
| PACKAGE | Package | |
| Weight | TON | Ton |
| KILOGRAM | Kilogram | |
| Other | OTHER | Other |
Request Example
curl --location 'http://127.0.0.1:8085/anymetrics/api/v1/metrics/detail?metricName=mc2db8445b3a7148b7bc6ba8b853aa44' \
--header 'tenant-id: tn_21571046' \
--header 'auth-value: authority_test' \
--header 'auth-type: ACCOUNT' \
--header 'Content-Type: application/json' \
--header 'queryBy: UUID' \
Response Example
{
"data": {
"basicAttributes": {},
"businessAttributes": {},
"technicalAttributes": {},
"managementAttributes": {},
"code": "1d45e0191f9348dd9a242fa0839d13a9",
"metricName": "ordercount_12",
"metricDisplayName": "Order Count_Custom Aggregate Function 4",
"businessCaliber": "Metric 1 created through OpenAPI.",
"owner": "correctness_test_qq",
"businessOwner": "correctness_test_qq",
"type": "ATOMIC",
"caliber": {
"datasetName": "can_order",
"expr": "count(['can_order'/'order_id'])",
"formula": null,
"filters": [
{
"type": "EXPR",
"expr": "IN(['can_product'/'brand_name'],\"Huawei\")"
}
],
"metricTime": "order_date",
"enableNonAdditiveDimensions": null,
"nonAdditiveDimensions": null,
"fingerPrint": null
},
"unit": "OTHER",
"metricCategoryId": "-1",
"metricViewCount": 0,
"publishStatus": "PUBLISHED",
"status": "ONLINE"
},
"success": true,
"code": "200",
"errorMsg": null,
"detailErrorMsg": null,
"traceId": "f6e656798ed241c789f7132823c46c6b.145.17194017310870337"
}