获取汇总表格数据
功能介绍
获取汇总表格数据。
URI
POST /v1/apm2/openapi/view/metric/sum-table
请求参数
参数 |
是否必选 |
参数类型 |
描述 |
---|---|---|---|
x-business-id |
是 |
Long |
应用id。 |
X-Auth-Token |
是 |
String |
从IAM服务获取的用户Token。 |
参数 |
是否必选 |
参数类型 |
描述 |
---|---|---|---|
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 |
结束时间。 |
参数 |
是否必选 |
参数类型 |
描述 |
---|---|---|---|
view_type |
是 |
String |
视图类型。 枚举值:
|
collector_name |
是 |
String |
采集器名称。 |
metric_set |
是 |
String |
视图对应的指标集的名称。 |
title |
否 |
String |
图标所需展示的标题。 |
table_direction |
否 |
String |
表格的方向,H:默认,表头横向,V:表头纵向。 枚举值:
|
group_by |
否 |
String |
分组规则。 |
filter |
否 |
String |
过滤列表模型。 |
field_item_list |
是 |
Array of FieldItem objects |
所需展示的字段列表模型列表。 |
span |
否 |
Boolean |
跨度。 |
span_field |
否 |
String |
跨度字段。 |
order_by |
否 |
String |
排序规则。 |
latest |
否 |
Boolean |
是否只展示最近一笔数据。 |
响应参数
状态码: 200
参数 |
参数类型 |
描述 |
---|---|---|
result_id |
String |
结果的ID信息,分页查询的时候带过来。 |
row_list |
Array of FrontRow objects |
数据行列表。 |
latest_data_Time |
Long |
最近一笔数据的时间。 |
table_direction |
String |
表格的方向,H:默认,表头横向,V:表头纵向。 枚举值:
|
real_start_time |
Long |
实际开始的时间。 |
real_end_time |
Long |
实际结束的时间。 |
notice_msg |
String |
提示信息。 |
total_count |
Integer |
总数。 |
参数 |
参数类型 |
描述 |
---|---|---|
cell_list |
Array of FrontCell objects |
数据单元集合。 |
filter |
String |
将group by的字段拼接成过滤字符串,用于后续点网格单击使用。 |
header |
Boolean |
是否是header信息。 |
tx_id |
Long |
Url跟踪id。 |
请求示例
获取汇总表格数据,入参为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,请求响应成功。 |
401 |
Unauthorized,没有权限。 |
403 |
Forbidden,禁止访问。 |
404 |
Not Found,没有找到要请求的资源。 |
错误码
请参见错误码。