更新时间:2024-04-29 GMT+08:00
分享

获取原始数据表格

功能介绍

获取原始数据表格。

调试

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

URI

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

请求参数

表1 请求Header参数

参数

是否必选

参数类型

描述

X-Auth-Token

String

从IAM服务获取的用户Token。

x-business-id

Long

应用id。

表2 请求Body参数

参数

是否必选

参数类型

描述

last_row_id

String

上一次扫描的数据ID。

view_config

RawTableView object

原始数据表格视图。

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 RawTableView

参数

是否必选

参数类型

描述

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参数

参数

参数类型

描述

row_list

Array of FrontRow objects

数据行。

latest_data_Time

String

最近一笔数据的时间。

table_direction

String

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

枚举值:

  • H
  • V

result_id

String

上次请求id。

real_start_time

Long

实际开始的时间,主要用于下一次调用,特别是分页调用的时候传的参数。

real_end_time

Long

实际结束的时间。

表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参数为rawtable的视图配置,可从查询监控项配置信息接口获取。

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

{
  "end_time" : 1667436600000,
  "env_id" : "913",
  "instance_id" : "13",
  "monitor_item_id" : 10499,
  "page" : 1,
  "page_size" : 10,
  "search_word" : "",
  "start_time" : 1667435400000,
  "view_config" : {
    "span" : null,
    "latest" : null,
    "collector_name" : "Exception",
    "metric_set" : "exception",
    "title" : "异常堆栈",
    "table_direction" : null,
    "group_by" : "",
    "filter" : "className=com.*.*.*.*.apm.alarm.service.impl.AviatorService^exceptionType=java.lang.ClassCastException^logType=sl4j_logback_error",
    "field_item_list" : [ {
      "trace" : null,
      "function" : "stackTrace",
      "as" : "异常堆栈",
      "default_value" : null,
      "precision" : null,
      "unit" : null,
      "visible" : true
    } ],
    "span_field" : null,
    "view_type" : "rawtable"
  }
}

响应示例

状态码: 200

OK,请求响应成功。

{
  "row_list" : [ {
    "header" : true,
    "cell_list" : [ {
      "span" : null,
      "trace" : null,
      "data_type" : "STRING",
      "function" : null,
      "span_field" : null,
      "precision" : null,
      "text" : "time",
      "unit" : null,
      "visible" : true
    }, {
      "span" : null,
      "trace" : null,
      "data_type" : "CLOB",
      "function" : null,
      "span_field" : null,
      "precision" : null,
      "text" : "异常堆栈",
      "unit" : null,
      "visible" : true
    } ],
    "filter" : null,
    "tx_id" : null
  }, {
    "header" : null,
    "cell_list" : [ {
      "span" : null,
      "trace" : null,
      "data_type" : null,
      "function" : null,
      "span_field" : null,
      "precision" : null,
      "text" : "2022-11-03 08:41:00",
      "unit" : null,
      "visible" : true
    }, {
      "span" : null,
      "trace" : null,
      "data_type" : null,
      "function" : null,
      "span_field" : null,
      "precision" : null,
      "text" : "6-973f4c1c78928bcf67d67dfaccc9d3a09f3cef97b2de70bd11f103a1af449b94",
      "unit" : null,
      "visible" : true
    } ],
    "filter" : null,
    "tx_id" : null
  } ],
  "latest_data_Time" : "2022-11-03 08:41:00",
  "table_direction" : "H",
  "result_id" : null,
  "real_start_time" : 1667435400000,
  "real_end_time" : 1667436600000
}

状态码

状态码

描述

200

OK,请求响应成功。

400

Bad Request,语义或参数有误。

401

Unauthorized,没有权限。

403

Forbidden,禁止访问。

404

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

错误码

请参见错误码

分享:

    相关文档

    相关产品