量度端點
可觀察性量度可針對Adobe Experience Platform中的各種功能,提供使用狀況統計資料、歷史趨勢和績效指標的深入分析。 此 /metrics
中的端點 Observability Insights API 可讓您以程式設計方式擷取您組織活動的量度資料,位置在: Platform.
快速入門
本指南中使用的API端點是 Observability Insights API. 在繼續之前,請檢閱 快速入門手冊 如需相關檔案的連結,請參閱本檔案範例API呼叫的閱讀指南,以及有關成功對任一檔案發出呼叫所需必要標題的重要資訊 Experience Platform API。
擷取可觀察性量度
您可以透過向以下專案發出POST請求來擷取量度資料: /metrics
端點,指定您要在裝載中擷取的量度。
API格式
POST /metrics
要求
curl -X POST \
https://platform.adobe.io/data/infrastructure/observability/insights/metrics \
-H 'Authorization: Bearer {ACCESS_TOKEN}' \
-H 'x-api-key: {API_KEY}' \
-H 'x-gw-ims-org-id: {ORG_ID}' \
-H 'x-sandbox-name: {SANDBOX_NAME}' \
-d '{
"start": "2020-07-14T00:00:00.000Z",
"end": "2020-07-22T00:00:00.000Z",
"granularity": "day",
"metrics": [
{
"name": "timeseries.ingestion.dataset.recordsuccess.count",
"filters": [
{
"name": "dataSetId",
"value": "5edcfb2fbb642119194c7d94|5eddb21420f516191b7a8dad",
"groupBy": true
}
],
"aggregator": "sum",
"downsample": "sum"
},
{
"name": "timeseries.ingestion.dataset.dailysize",
"filters": [
{
"name": "dataSetId",
"value": "5eddb21420f516191b7a8dad",
"groupBy": false
}
],
"aggregator": "sum",
"downsample": "sum"
}
]
}'
start
end
granularity
DAY
傳回介於以下日期之間的每日量度: start
和 end
日期,而值 MONTH
會改為按月分組量度結果。 使用此欄位時,對應欄位 downsample
也必須提供屬性,以指示用來群組資料的彙總函式。metrics
name
filters
選擇性欄位,可讓您依據特定資料集篩選量度。 欄位是一個物件陣列(每個濾鏡各一個),每個物件包含下列屬性:
name
:要篩選量度的實體型別。 目前,僅限dataSets
支援。value
:一或多個資料集的ID。 多個資料集ID可作為單一字串提供,每個ID都以垂直長條字元(|
)。groupBy
:設為true時,代表對應的value
代表應個別傳回其量度結果的多個資料集。 如果設為false,則這些資料集的量度結果會分組在一起。
aggregator
downsample
granularity
屬性。 如需縮減取樣的相關詳細資訊,請參閱 OpenTSDB檔案.回應
成功的回應會針對請求中指定的量度和篩選器傳回產生的資料點。
{
"metricResponses": [
{
"metric": "timeseries.ingestion.dataset.recordsuccess.count",
"filters": [
{
"name": "dataSetId",
"value": "5edcfb2fbb642119194c7d94|5eddb21420f516191b7a8dad",
"groupBy": true
}
],
"datapoints": [
{
"groupBy": {
"dataSetId": "5edcfb2fbb642119194c7d94"
},
"dps": {
"2020-07-14T00:00:00Z": 44.0,
"2020-07-15T00:00:00Z": 46.0,
"2020-07-16T00:00:00Z": 36.0,
"2020-07-17T00:00:00Z": 50.0,
"2020-07-18T00:00:00Z": 38.0,
"2020-07-19T00:00:00Z": 40.0,
"2020-07-20T00:00:00Z": 42.0,
"2020-07-21T00:00:00Z": 42.0,
"2020-07-22T00:00:00Z": 50.0
}
},
{
"groupBy": {
"dataSetId": "5eddb21420f516191b7a8dad"
},
"dps": {
"2020-07-14T00:00:00Z": 44.0,
"2020-07-15T00:00:00Z": 46.0,
"2020-07-16T00:00:00Z": 36.0,
"2020-07-17T00:00:00Z": 50.0,
"2020-07-18T00:00:00Z": 38.0,
"2020-07-19T00:00:00Z": 40.0,
"2020-07-20T00:00:00Z": 42.0,
"2020-07-21T00:00:00Z": 42.0,
"2020-07-22T00:00:00Z": 50.0
}
}
],
"granularity": "DAY"
},
{
"metric": "timeseries.ingestion.dataset.dailysize",
"filters": [
{
"name": "dataSetId",
"value": "5eddb21420f516191b7a8dad",
"groupBy": false
}
],
"datapoints": [
{
"groupBy": {},
"dps": {
"2020-07-14T00:00:00Z": 38455.0,
"2020-07-15T00:00:00Z": 40213.0,
"2020-07-16T00:00:00Z": 31476.0,
"2020-07-17T00:00:00Z": 43705.0,
"2020-07-18T00:00:00Z": 33227.0,
"2020-07-19T00:00:00Z": 34977.0,
"2020-07-20T00:00:00Z": 36735.0,
"2020-07-21T00:00:00Z": 36737.0,
"2020-07-22T00:00:00Z": 43715.0
}
}
],
"granularity": "DAY"
}
]
}
metricResponses
metric
filters
datapoints
groupBy
filter
量度的屬性,以及 groupBy
選項在請求中設為true,此物件將包含對應資料集的識別碼 dps
屬性套用至。如果此物件在回應中顯示為空白,則對應的
dps
屬性會套用至 filters
陣列(或中的所有資料集) Platform (若未提供任何篩選器)。dps
granularity
請求中指定的值。附錄
下節包含有關使用的其他資訊 /metrics
端點。
可用量度 available-metrics
下表列出以下對象公開的所有量度: Observability Insights,劃分依據 Platform 服務。 每個量度都包含說明和接受的ID查詢引數。
Data Ingestion ingestion
下表概述Adobe Experience Platform的量度 Data Ingestion. 中的量度 粗體 是串流擷取量度。
Identity Service identity
下表概述Adobe Experience Platform的量度 Identity Service.
Real-Time Customer Profile profile
下表概述以下專案的量度 Real-Time Customer Profile.
錯誤訊息
來自 /metrics
端點在某些情況下可能會傳回錯誤訊息。 這些錯誤訊息會以下列格式傳回:
{
"type": "http://ns.adobe.com/aep/errors/INSGHT-1000-400",
"title": "Bad Request - Start date cannot be after end date.",
"status": 400,
"report": {
"tenantInfo": {
"sandboxName": "prod",
"sandboxId": "49f58060-5d47-34rd-aawf-a5384333ff12",
"imsOrgId": "{ORG_ID}"
},
"additionalContext": null
},
"error-chain": [
{
"serviceId": "INSGHT",
"errorCode": "INSGHT-1000-400",
"invokingServiceId": "INSGHT",
"unixTimeStampMs": 1602095177129
}
]
}
title
report
下表列出API可傳回的不同錯誤代碼:
INSGHT-1000-400
請求承載發生問題。 請確定您完全符合顯示的裝載格式 以上. 任何可能的原因都會觸發此錯誤:
- 缺少必填欄位,例如
aggregator
- 無效的量度
- 請求包含無效的彙總
- 開始日期發生在結束日期之後
INSGHT-1001-400
INSGHT-1001-500
INSGHT-1002-500
INSGHT-1003-401
x-sandbox-name
標題代表貴組織在重試請求之前啟用的有效沙箱。