全部產品
Search
文件中心

Application Real-Time Monitoring Service:QueryCommercialUsage - 查詢可觀測用量資料

更新時間:Apr 10, 2026

查詢寫入量資料,支援應用監控、可觀測鏈路OpenTelemetry版、Prometheus、使用者體驗監控四大產品用量資料。

調試

您可以在OpenAPI Explorer中直接運行該介面,免去您計算簽名的困擾。運行成功後,OpenAPI Explorer可以自動產生SDK程式碼範例。

調試

授權資訊

當前API暫無授權資訊透出。

請求參數

名稱

類型

必填

描述

樣本值

IntervalInSec

integer

資料片的時間間隔,單位為秒,最小值為 3600。

枚舉值:

  • 3600 :

    小時

  • 86400 :

3600

StartTime

integer

起始時間的時間戳記,精確到毫秒。

1699200000000

EndTime

integer

結束時間的時間戳記,精確到毫秒。

1699286400000

OrderBy

string

排序依據,可設為任一 dimesion

枚舉值:

  • dataType :

    dataType

dataType

Metric

string

指標名稱,取值:USAGEFEE.STAT

枚舉值:

  • USAGEFEE.STAT :

    USAGEFEE.STAT

USAGEFEE.STAT

Order

string

排序標準。取值:

  • ASC:升序。

  • DESC:降序。

ASC

AdvancedFilters

array<object>

過濾條件數組

object

Key

string

過濾條件的 key

regionId

Value

string

過濾條件的 value

cn-hangzhou

OpType

string

操作符,目前僅支援等於或者 in

枚舉值:

  • in :

    in

  • eq :

    eq

eq

Dimensions

array

指標對應的維度。

  • dataType 資料類型

  • productType 產品類型

  • instanceId 執行個體 ID

  • instanceName 執行個體名稱

  • instanceType 執行個體類型

string

指標對應的維度。

dataType

Measures

array

指標對應的測量資料。

string

指標對應的測量資料。目前僅支援 byte_sum

枚舉值:

  • byte_sum :

    byte_sum

byte_sum

QueryType

string

查詢的資料傳回型別:

  • instantQuery 非時序

  • timeSeriesQuery 時序

枚舉值:

  • timeSeriesQuery :

    timeSeriesQuery

  • instantQuery :

    instantQuery

instantQuery

返回參數

名稱

類型

描述

樣本值

object

Code

integer

介面狀態,取值說明如下:2XX:成功。3XX:重新導向。4XX:請求錯誤。5XX:伺服器錯誤。

200

HttpStatusCode

integer

HTTP 狀態代碼

200

Message

string

調用失敗時返回的資訊。

success

RequestId

string

請求 ID。

99A663CB-8D7B-4B0D-A006-03C8EE38E7BB

Success

boolean

查詢是否成功:

  • true:成功。

  • false:失敗。

true

Data

object

返回結構體。

Complete

boolean

涉及到多地區查詢是,整體是否執行完成:

  • true:是。

  • false:否。

true

Items

array<object>

返回資料的資料結構體列表。

object

資料項目

{ "date": "1697108400", "dataType": "metrics", "byte_sum": 9497922 }

樣本

正常返回樣本

JSON格式

{
  "Code": 200,
  "HttpStatusCode": 200,
  "Message": "success",
  "RequestId": "99A663CB-8D7B-4B0D-A006-03C8EE38E7BB",
  "Success": true,
  "Data": {
    "Complete": true,
    "Items": [
      {
        "date": "1697108400",
        "dataType": "metrics",
        "byte_sum": 9497922
      }
    ]
  }
}

錯誤碼

HTTP status code

錯誤碼

錯誤資訊

描述

400 ParameterMetricIllegal The specified metric is invalid. 參數metric非法
400 ParameterMeasuresIllegal The specified Measures is invalid. Measures非法
400 ParameterTimeStampIllegal The specified timeStamp is invalid. 時間參數非法
400 ParameterOrderIllegal The specified order is invalid. 參數order非法
400 ParameterPageSizeIllegal The specified PageSize is invalid. PageSize非法
400 ParameterIntervalIllegal The specified interval is invalid. 參數Interval非法
400 ParameterMeasuresMissing You must specify measures. 參數measures缺失
400 ParameterDimensionsIllegal The specified dimensions is invalid. Dimensions非法
400 ParameterRegionIdIllegal The specified RegionId is invalid. RegionId非法
400 InternalError Internal error. Please try again. Contact the DingTalk service account if the issue persists after multiple retries.
403 APINotAuthorize The current user is not authorized to access the interface. 目前使用者無許可權訪問該介面

訪問錯誤中心查看更多錯誤碼。

變更歷史

更多資訊,參考變更詳情