更新时间:2023-09-08 GMT+08:00
分享

获取汇总表格数据

功能介绍

获取汇总表格数据。

调试

您可以在API Explorer中调试该接口,支持自动认证鉴权。API Explorer可以自动生成SDK代码示例,并提供SDK代码示例调试功能。

URI

POST /v1/apm2/openapi/view/metric/sum-table

请求参数

表1 请求Header参数

参数

是否必选

参数类型

描述

x-business-id

Long

应用id。

X-Auth-Token

String

从IAM服务获取的用户Token。

表2 请求Body参数

参数

是否必选

参数类型

描述

request_id

String

上次请求的id。

view_config

SumTableView object

视图配置信息。

strategy

String

策略。

page

Integer

当前页码。

page_size

Integer

每页数据总数。

order_by

String

排序规则。

search_word

String

搜索关键字。

instance_id

Long

实例id。

monitor_item_id

Long

监控项id。

env_id

Long

环境id。

start_time

String

起始时间。

end_time

String

结束时间。

表3 SumTableView

参数

是否必选

参数类型

描述

view_type

String

视图类型。

枚举值:

  • trend
  • sumtable
  • rawtable

collector_name

String

采集器名称。

metric_set

String

视图对应的指标集的名称。

title

String

图标所需展示的标题。

table_direction

String

表格的方向,H:默认,表头横向,V:表头纵向。

枚举值:

  • H
  • V

group_by

String

分组规则。

filter

String

过滤列表模型。

field_item_list

Array of FieldItem objects

所需展示的字段列表模型列表。

span

Boolean

跨度。

span_field

String

跨度字段。

order_by

String

排序规则。

latest

Boolean

是否只展示最近一笔数据。

表4 FieldItem

参数

是否必选

参数类型

描述

function

String

表达式。

as

String

作为。

default_value

String

默认值。

trace

Boolean

是否是trace。

precision

Integer

百分比。

unit

String

单位。

visible

Boolean

是否可见。

响应参数

状态码: 200

表5 响应Body参数

参数

参数类型

描述

result_id

String

结果的ID信息,分页查询的时候带过来。

row_list

Array of FrontRow objects

数据行列表。

latest_data_Time

Long

最近一笔数据的时间。

table_direction

String

表格的方向,H:默认,表头横向,V:表头纵向。

枚举值:

  • H
  • V

real_start_time

Long

实际开始的时间。

real_end_time

Long

实际结束的时间。

notice_msg

String

提示信息。

total_count

Integer

总数。

表6 FrontRow

参数

参数类型

描述

cell_list

Array of FrontCell objects

数据单元集合。

filter

String

将group by的字段拼接成过滤字符串,用于后续点网格单击使用。

header

Boolean

是否是header信息。

tx_id

Long

Url跟踪id。

表7 FrontCell

参数

参数类型

描述

data_type

String

数据类型。

function

String

函数。

trace

Boolean

是否调用链。

span

Boolean

是否是span信息,如果是就跳到调用链搜索页面。

span_field

String

span字段。

precision

Integer

小数点位数。

text

String

文本信息。

unit

String

单位。

visible

Boolean

是否可见。

请求示例

获取汇总表格数据,入参为view_type参数为sumtable的视图配置,可从查询监控项配置信息接口获取。

/v1/apm2/openapi/view/metric/sum-table

{
  "end_time" : "2022-10-25 15:17:46",
  "env_id" : "11",
  "monitor_item_id" : 78,
  "page" : 1,
  "page_size" : 10,
  "start_time" : "2022-10-25 14:57:46",
  "view_config" : {
    "latest" : null,
    "span" : true,
    "collector_name" : "Url",
    "metric_set" : "url",
    "title" : "接口维度汇总",
    "table_direction" : null,
    "group_by" : "url,method",
    "filter" : "",
    "field_item_list" : [ {
      "trace" : null,
      "function" : "SUM(invokeCount)",
      "as" : "调用次数",
      "default_value" : null,
      "precision" : null,
      "unit" : null,
      "visible" : true
    }, {
      "trace" : null,
      "function" : "SUM(totalTime)/SUM(invokeCount)",
      "as" : "平均响应时间(ms)",
      "default_value" : null,
      "precision" : null,
      "unit" : null,
      "visible" : true
    }, {
      "trace" : null,
      "function" : "SUM(errorCount)",
      "as" : "错误数",
      "default_value" : null,
      "precision" : null,
      "unit" : null,
      "visible" : true
    }, {
      "trace" : null,
      "function" : "MAX(concurrentMax)",
      "as" : "最大并发",
      "default_value" : null,
      "precision" : null,
      "unit" : null,
      "visible" : true
    }, {
      "trace" : null,
      "function" : "MAX(maxTime)",
      "as" : "最慢调用(ms)",
      "default_value" : null,
      "precision" : null,
      "unit" : null,
      "visible" : true
    }, {
      "trace" : null,
      "function" : "SUM(range1)",
      "as" : "0ms-10ms",
      "default_value" : null,
      "precision" : null,
      "unit" : null,
      "visible" : false
    }, {
      "trace" : null,
      "function" : "SUM(range2)",
      "as" : "10ms-100ms",
      "default_value" : null,
      "precision" : null,
      "unit" : null,
      "visible" : false
    }, {
      "trace" : null,
      "function" : "SUM(range3)",
      "as" : "100ms-500ms",
      "default_value" : null,
      "precision" : null,
      "unit" : null,
      "visible" : false
    }, {
      "trace" : null,
      "function" : "SUM(range4)",
      "as" : "500ms-1s",
      "default_value" : null,
      "precision" : null,
      "unit" : null,
      "visible" : false
    }, {
      "trace" : null,
      "function" : "SUM(range5)",
      "as" : "1s-10s",
      "default_value" : null,
      "precision" : null,
      "unit" : null,
      "visible" : false
    }, {
      "trace" : null,
      "function" : "SUM(range6)",
      "as" : "10s-n",
      "default_value" : null,
      "precision" : null,
      "unit" : null,
      "visible" : false
    } ],
    "span_field" : "source",
    "view_type" : "sumtable"
  }
}

响应示例

状态码: 200

OK,请求响应成功。

{
  "result_id" : "12ece6d8-b146-435d-ad51-be0e43e27490",
  "row_list" : [ {
    "header" : true,
    "cell_list" : [ {
      "trace" : false,
      "span" : true,
      "data_type" : "ENUM",
      "function" : "",
      "span_field" : "source",
      "precision" : null,
      "text" : "url",
      "unit" : null,
      "visible" : true
    }, {
      "trace" : false,
      "span" : null,
      "data_type" : "ENUM",
      "function" : "",
      "span_field" : null,
      "precision" : null,
      "text" : "method",
      "unit" : null,
      "visible" : true
    }, {
      "trace" : null,
      "span" : null,
      "data_type" : "INT",
      "function" : "SUM(invokeCount) as=调用次数",
      "span_field" : null,
      "precision" : null,
      "text" : "调用次数",
      "unit" : null,
      "visible" : true
    }, {
      "trace" : null,
      "span" : null,
      "data_type" : "DOUBLE",
      "function" : "SUM(totalTime)/SUM(invokeCount) as=平均响应时间(ms)",
      "span_field" : null,
      "precision" : null,
      "text" : "平均响应时间(ms)",
      "unit" : null,
      "visible" : true
    }, {
      "trace" : null,
      "span" : null,
      "data_type" : "INT",
      "function" : "SUM(errorCount) as=错误数",
      "span_field" : null,
      "precision" : null,
      "text" : "错误数",
      "unit" : null,
      "visible" : true
    }, {
      "trace" : null,
      "span" : null,
      "data_type" : "INT",
      "function" : "MAX(concurrentMax) as=最大并发",
      "span_field" : null,
      "precision" : null,
      "text" : "最大并发",
      "unit" : null,
      "visible" : true
    }, {
      "trace" : null,
      "span" : null,
      "data_type" : "INT",
      "function" : "MAX(maxTime) as=最慢调用(ms)",
      "span_field" : null,
      "precision" : null,
      "text" : "最慢调用(ms)",
      "unit" : null,
      "visible" : true
    }, {
      "trace" : null,
      "span" : null,
      "data_type" : "INT",
      "function" : "SUM(range1) as=0ms-10ms",
      "span_field" : null,
      "precision" : null,
      "text" : "0ms-10ms",
      "unit" : null,
      "visible" : false
    }, {
      "trace" : null,
      "span" : null,
      "data_type" : "INT",
      "function" : "SUM(range2) as=10ms-100ms",
      "span_field" : null,
      "precision" : null,
      "text" : "10ms-100ms",
      "unit" : null,
      "visible" : false
    }, {
      "trace" : null,
      "span" : null,
      "data_type" : "INT",
      "function" : "SUM(range3) as=100ms-500ms",
      "span_field" : null,
      "precision" : null,
      "text" : "100ms-500ms",
      "unit" : null,
      "visible" : false
    }, {
      "trace" : null,
      "span" : null,
      "data_type" : "INT",
      "function" : "SUM(range4) as=500ms-1s",
      "span_field" : null,
      "precision" : null,
      "text" : "500ms-1s",
      "unit" : null,
      "visible" : false
    }, {
      "trace" : null,
      "span" : null,
      "data_type" : "INT",
      "function" : "SUM(range5) as=1s-10s",
      "span_field" : null,
      "precision" : null,
      "text" : "1s-10s",
      "unit" : null,
      "visible" : false
    }, {
      "trace" : null,
      "span" : null,
      "data_type" : "INT",
      "function" : "SUM(range6) as=10s-n",
      "span_field" : null,
      "precision" : null,
      "text" : "10s-n",
      "unit" : null,
      "visible" : false
    } ],
    "filter" : null,
    "tx_id" : null
  }, {
    "header" : null,
    "cell_list" : [ {
      "trace" : null,
      "span" : null,
      "data_type" : null,
      "function" : null,
      "span_field" : null,
      "precision" : null,
      "text" : "/apm2/health/v1/health-check",
      "unit" : null,
      "visible" : true
    }, {
      "trace" : null,
      "span" : null,
      "data_type" : null,
      "function" : null,
      "span_field" : null,
      "precision" : null,
      "text" : "GET",
      "unit" : null,
      "visible" : true
    }, {
      "trace" : null,
      "span" : null,
      "data_type" : null,
      "function" : null,
      "span_field" : null,
      "precision" : null,
      "text" : "144",
      "unit" : null,
      "visible" : true
    }, {
      "trace" : null,
      "span" : null,
      "data_type" : null,
      "function" : null,
      "span_field" : null,
      "precision" : null,
      "text" : "0.89",
      "unit" : null,
      "visible" : true
    }, {
      "trace" : null,
      "span" : null,
      "data_type" : null,
      "function" : null,
      "span_field" : null,
      "precision" : null,
      "text" : "0",
      "unit" : null,
      "visible" : true
    }, {
      "trace" : null,
      "span" : null,
      "data_type" : null,
      "function" : null,
      "span_field" : null,
      "precision" : null,
      "text" : "1",
      "unit" : null,
      "visible" : true
    }, {
      "trace" : null,
      "span" : null,
      "data_type" : null,
      "function" : null,
      "span_field" : null,
      "precision" : null,
      "text" : "2",
      "unit" : null,
      "visible" : true
    }, {
      "trace" : null,
      "span" : null,
      "data_type" : null,
      "function" : null,
      "span_field" : null,
      "precision" : null,
      "text" : "144",
      "unit" : null,
      "visible" : true
    }, {
      "trace" : null,
      "span" : null,
      "data_type" : null,
      "function" : null,
      "span_field" : null,
      "precision" : null,
      "text" : "0",
      "unit" : null,
      "visible" : true
    }, {
      "trace" : null,
      "span" : null,
      "data_type" : null,
      "function" : null,
      "span_field" : null,
      "precision" : null,
      "text" : "0",
      "unit" : null,
      "visible" : true
    }, {
      "trace" : null,
      "span" : null,
      "data_type" : null,
      "function" : null,
      "span_field" : null,
      "precision" : null,
      "text" : "0",
      "unit" : null,
      "visible" : true
    }, {
      "trace" : null,
      "span" : null,
      "data_type" : null,
      "function" : null,
      "span_field" : null,
      "precision" : null,
      "text" : "0",
      "unit" : null,
      "visible" : true
    }, {
      "trace" : null,
      "span" : null,
      "data_type" : null,
      "function" : null,
      "span_field" : null,
      "precision" : null,
      "text" : "0",
      "unit" : null,
      "visible" : true
    } ],
    "filter" : "url=/apm2/health/v1/health-check^method=GET",
    "tx_id" : null
  } ],
  "latest_data_Time" : 1666682040000,
  "table_direction" : "H",
  "real_start_time" : 1666681020000,
  "real_end_time" : 1666682220000,
  "notice_msg" : null,
  "total_count" : 1
}

状态码

状态码

描述

200

OK,请求响应成功。

400

Bad Request,语义或参数有误。

401

Unauthorized,没有权限。

403

Forbidden,禁止访问。

404

Not Found,没有找到要请求的资源。

错误码

请参见错误码

分享:

    相关文档

    相关产品