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

查询组件环境拓扑图

功能介绍

查询组件环境级别全局拓扑图信息。

调试

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

URI

POST /v1/apm2/openapi/topology/env-search

请求参数

表1 请求Header参数

参数

是否必选

参数类型

描述

X-Auth-Token

String

从IAM服务获取的用户Token。

x-business-id

Long

应用id。

表2 请求Body参数

参数

是否必选

参数类型

描述

target_env_id

Long

环境id。

direction

String

方向,可为空。

end_time

String

结束时间。

start_time

String

开始时间。

filter_user

Boolean

过滤。

响应参数

状态码: 200

表3 响应Body参数

参数

参数类型

描述

node_list

Array of TopoNode objects

组件节点列表。

line_list

Array of TopoLine objects

组件之间调用指向线列表。

collector_config

Map<String,CollectorConfigModel>

采集器配置。

real_start_time

Long

开始时间。

real_end_time

Long

结束时间。

表4 TopoNode

参数

参数类型

描述

node_type

String

节点类型。

node_name

String

节点名称。

node_id

String

节点id。

env_id

Long

环境id。

表5 TopoLine

参数

参数类型

描述

from_node

String

开始节点。

to_node

String

结束节点。

direction

String

指向。

collector

String

采集器名称。

target_env_id

Long

环境id。

hints

Map<String,String>

线条上的提示信息。

filter_value

String

过滤值。

表6 CollectorConfigModel

参数

参数类型

描述

line_view_config

LineViewConfigModel object

指向线视图配置。

detail_view_config

DetailViewConfigModel object

详情视图配置。

表7 LineViewConfigModel

参数

参数类型

描述

metric_set

String

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

filter_prefix

String

过滤参数。

line_view_item_list

Array of LineViewItem objects

视图函数集合。

表8 LineViewItem

参数

参数类型

描述

function

String

表达式。

as

String

作为。

表9 DetailViewConfigModel

参数

参数类型

描述

metric_set

String

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

filter_prefix

String

过滤参数。

detail_view_item_list

Array of DetailViewItem objects

视图函数集合。

表10 DetailViewItem

参数

参数类型

描述

function

String

表达式。

as

String

作为。

请求示例

查询目标环境ID为4394,开始时间戳为1667465258000,结束时间戳为1667466458000的环境级别全局拓扑图信息。

/v1/apm2/openapi/topology/env-search

{
  "direction" : "",
  "end_time" : 1667466458000,
  "start_time" : 1667465258000,
  "filter_user" : false,
  "target_env_id" : 4394
}

响应示例

状态码: 200

OK,请求响应成功。

{
  "node_list" : [ {
    "node_type" : "Env",
    "node_name" : "apm-archive:xx-xxx-xxx",
    "node_id" : "4394",
    "env_id" : 4394
  }, {
    "node_type" : "Kafka",
    "node_name" : "Kafka",
    "node_id" : "Kafka",
    "env_id" : null
  }, {
    "node_type" : "Env",
    "node_name" : "config-web:xx-xxxx-204",
    "node_id" : "1927",
    "env_id" : 1927
  }, {
    "node_type" : "Env",
    "node_name" : "config-web:xx-xxxx-xxx",
    "node_id" : "51",
    "env_id" : 51
  }, {
    "node_type" : "Env",
    "node_name" : "user",
    "node_id" : "user",
    "env_id" : null
  } ],
  "line_list" : [ {
    "from_node" : "user",
    "to_node" : "4394",
    "direction" : "in",
    "collector" : "Url",
    "target_env_id" : 4394,
    "hints" : {
      "rt" : "0.09",
      "count" : "680",
      "error" : "0"
    },
    "filter_value" : "user"
  }, {
    "from_node" : "4394",
    "to_node" : "51",
    "direction" : "out",
    "collector" : "HttpClient",
    "target_env_id" : 4394,
    "hints" : {
      "rt" : "33.27",
      "count" : "668",
      "error" : "0"
    },
    "filter_value" : "51"
  }, {
    "from_node" : "Kafka",
    "to_node" : "4394",
    "direction" : "in",
    "collector" : "KafkaConsumer",
    "target_env_id" : 4394,
    "hints" : {
      "bytes" : "-1448635860",
      "count" : "4163226"
    },
    "filter_value" : "Kafka"
  }, {
    "from_node" : "4394",
    "to_node" : "Kafka",
    "direction" : "out",
    "collector" : "KafkaProducer",
    "target_env_id" : 4394,
    "hints" : {
      "bytes" : "0",
      "count" : "0"
    },
    "filter_value" : "Kafka"
  }, {
    "from_node" : "4394",
    "to_node" : "1927",
    "direction" : "out",
    "collector" : "HttpClient",
    "target_env_id" : 4394,
    "hints" : {
      "rt" : "41.64",
      "count" : "170",
      "error" : "0"
    },
    "filter_value" : "1927"
  } ],
  "collector_config" : {
    "KafkaProducer" : {
      "line_view_config" : {
        "metric_set" : "total",
        "filter_prefix" : null,
        "line_view_item_list" : [ {
          "function" : "SUM(recordSendTotal)",
          "as" : "count"
        }, {
          "function" : "SUM(byteTotal)",
          "as" : "bytes"
        } ]
      },
      "detail_view_config" : {
        "metric_set" : "topic",
        "group_by" : "topic",
        "detail_view_item_list" : [ {
          "function" : "SUM(recordSendTotal)",
          "as" : "count"
        }, {
          "function" : "SUM(byteTotal)",
          "as" : "bytes"
        } ]
      }
    },
    "HttpClient" : {
      "line_view_config" : {
        "metric_set" : "hostInvocation",
        "filter_prefix" : "envId=",
        "line_view_item_list" : [ {
          "function" : "SUM(invokeCount)",
          "as" : "count"
        }, {
          "function" : "SUM(totalTime)/SUM(invokeCount)",
          "as" : "rt"
        }, {
          "function" : "SUM(errorCount)",
          "as" : "errorCount"
        } ]
      },
      "detail_view_config" : null
    },
    "KafkaConsumer" : {
      "line_view_config" : {
        "metric_set" : "total",
        "filter_prefix" : null,
        "line_view_item_list" : [ {
          "function" : "SUM(recordConsumedTotal)",
          "as" : "count"
        }, {
          "function" : "SUM(bytesConsumedTotal)",
          "as" : "bytes"
        } ]
      },
      "detail_view_config" : {
        "metric_set" : "topic",
        "group_by" : "topic",
        "detail_view_item_list" : [ {
          "function" : "SUM(recordConsumedTotal)",
          "as" : "count"
        }, {
          "function" : "SUM(bytesConsumedTotal)",
          "as" : "bytes"
        } ]
      }
    },
    "Url" : {
      "line_view_config" : {
        "metric_set" : "user",
        "filter_prefix" : "clusterId=",
        "line_view_item_list" : [ {
          "function" : "SUM(invokeCount)",
          "as" : "count"
        }, {
          "function" : "SUM(totalTime)/SUM(invokeCount)",
          "as" : "rt"
        }, {
          "function" : "SUM(errorCount)",
          "as" : "errorCount"
        } ]
      },
      "detail_view_config" : null
    }
  },
  "real_start_time" : 1667465258000,
  "real_end_time" : 1667466458000
}

状态码

状态码

描述

200

OK,请求响应成功。

400

Bad Request,语义或参数有误。

401

Unauthorized,没有权限。

403

Forbidden,禁止访问。

404

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

错误码

请参见错误码

分享:

    相关文档

    相关产品