Help Center/ Application Performance Management/ API Reference(2.0)/ APIs/ TOPOLOGY/ Querying the Global Topology of an Application
Updated on 2023-08-02 GMT+08:00

Querying the Global Topology of an Application

Function

This API is used to query the global topology of an application.

URI

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

Request Parameters

Table 1 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

User token obtained from IAM.

x-business-id

Yes

Long

Application ID.

Table 2 Request body parameters

Parameter

Mandatory

Type

Description

target_business_id

Yes

Long

Target application ID.

env_tag_list

No

Array of integers

Environment tag list, which can be left empty.

direction

No

String

Direction, which can be left empty.

end_time

Yes

String

End time.

start_time

Yes

String

Start time.

filter_user

No

Boolean

Filter or not.

Response Parameters

Status code: 200

Table 3 Response body parameters

Parameter

Type

Description

node_list

Array of TopoNode objects

List of component nodes.

line_list

Array of TopoLine objects

List of lines that indicate invocations between components.

collector_config

Map<String,CollectorConfigModel>

Collector configuration.

real_start_time

Long

Start time.

real_end_time

Long

End time.

Table 4 TopoNode

Parameter

Type

Description

node_type

String

Node type.

node_name

String

Node name.

node_id

String

Node ID.

env_id

Long

Environment ID.

Table 5 TopoLine

Parameter

Type

Description

from_node

String

Start node.

to_node

String

End node.

direction

String

Invocation direction.

collector

String

Collector name.

target_env_id

Long

Environment ID.

hints

Map<String,String>

Line prompt.

filter_value

String

Filtered value.

Table 6 CollectorConfigModel

Parameter

Type

Description

line_view_config

LineViewConfigModel object

Invocation line view configuration.

detail_view_config

DetailViewConfigModel object

Details view configuration.

Table 7 LineViewConfigModel

Parameter

Type

Description

metric_set

String

Name of the metric set corresponding to the view.

filter_prefix

String

Filtering parameter.

line_view_item_list

Array of LineViewItem objects

View function set.

Table 8 LineViewItem

Parameter

Type

Description

function

String

Expression.

as

String

As.

Table 9 DetailViewConfigModel

Parameter

Type

Description

metric_set

String

Name of the metric set corresponding to the view.

filter_prefix

String

Filtering parameter.

detail_view_item_list

Array of DetailViewItem objects

View function set.

Table 10 DetailViewItem

Parameter

Type

Description

function

String

Expression.

as

String

As.

Example Requests

Query the global topology of application 6, with the start timestamp set to 1667462525000 and end timestamp set to 1667463725000.

/v1/apm2/openapi/topology/business-search

{
  "direction" : "",
  "end_time" : 1667463725000,
  "start_time" : 1667462525000,
  "filter_user" : true,
  "target_business_id" : 6,
  "env_tag_list" : [ ]
}

Example Responses

Status code: 200

OK: The request is successful.

{
  "node_list" : [ {
    "node_type" : "Env",
    "node_name" : "apm-task:xx-xxx-xxx",
    "node_id" : "55",
    "env_id" : 55
  }, {
    "node_type" : "Env",
    "node_name" : "apm-api:xx-xxx-xxx",
    "node_id" : "45",
    "env_id" : 45
  }, {
    "node_type" : "Env",
    "node_name" : "apm-archive:xx-xxx-xxx",
    "node_id" : "4394",
    "env_id" : 4394
  }, {
    "node_type" : "Env",
    "node_name" : "apm-store:xx-xxx-xxx",
    "node_id" : "46",
    "env_id" : 46
  }, {
    "node_type" : "Env",
    "node_name" : "apm-store:xx-xxx-xxx",
    "node_id" : "47",
    "env_id" : 47
  }, {
    "node_type" : "Env",
    "node_name" : "apm-api:xx-xxx-xxx",
    "node_id" : "48",
    "env_id" : 48
  }, {
    "node_type" : "Env",
    "node_name" : "apm-pu-task:xx-xxx-xxx",
    "node_id" : "4396",
    "env_id" : 4396
  }, {
    "node_type" : "Env",
    "node_name" : "apm-pu-task:xx-xxx-xxx",
    "node_id" : "4397",
    "env_id" : 4397
  }, {
    "node_type" : "Env",
    "node_name" : "apm-deliver:xx-xxx-xxx",
    "node_id" : "1104",
    "env_id" : 1104
  }, {
    "node_type" : "Env",
    "node_name" : "apm-merge:xx-xxx-xxx",
    "node_id" : "3568",
    "env_id" : 3568
  }, {
    "node_type" : "Mysql",
    "node_name" : "Mysql",
    "node_id" : "Mysql",
    "env_id" : null
  }, {
    "node_type" : "Env",
    "node_name" : "apm-alarm:xx-xxx-xxx",
    "node_id" : "913",
    "env_id" : 913
  }, {
    "node_type" : "Env",
    "node_name" : "config-web:xx-xxx-xxx",
    "node_id" : "51",
    "env_id" : 51
  }, {
    "node_type" : "Env",
    "node_name" : "user",
    "node_id" : "user",
    "env_id" : null
  }, {
    "node_type" : "Env",
    "node_name" : "apm-access:xx-xxx-xxx",
    "node_id" : "42",
    "env_id" : 42
  }, {
    "node_type" : "Env",
    "node_name" : "apm-master:xx-xxx-xxx",
    "node_id" : "53",
    "env_id" : 53
  }, {
    "node_type" : "Env",
    "node_name" : "apm-front:xx-xxx-xxx",
    "node_id" : "54",
    "env_id" : 54
  }, {
    "node_type" : "Env",
    "node_name" : "apm-access:xx-xxx-xxx",
    "node_id" : "43",
    "env_id" : 43
  } ],
  "line_list" : [ {
    "from_node" : "user",
    "to_node" : "51",
    "direction" : "in",
    "collector" : "Url",
    "target_env_id" : 51,
    "hints" : {
      "rt" : "0.09",
      "count" : "272",
      "error" : "0"
    },
    "filter_value" : "user"
  }, {
    "from_node" : "47",
    "to_node" : "51",
    "direction" : "in",
    "collector" : "Url",
    "target_env_id" : 51,
    "hints" : {
      "rt" : "10.28",
      "count" : "780",
      "error" : "0"
    },
    "filter_value" : "47"
  }, {
    "from_node" : "4394",
    "to_node" : "51",
    "direction" : "in",
    "collector" : "Url",
    "target_env_id" : 51,
    "hints" : {
      "rt" : "29.49",
      "count" : "694",
      "error" : "0"
    },
    "filter_value" : "4394"
  }, {
    "from_node" : "46",
    "to_node" : "51",
    "direction" : "in",
    "collector" : "Url",
    "target_env_id" : 51,
    "hints" : {
      "rt" : "10.41",
      "count" : "843",
      "error" : "0"
    },
    "filter_value" : "46"
  }, {
    "from_node" : "4397",
    "to_node" : "51",
    "direction" : "in",
    "collector" : "Url",
    "target_env_id" : 51,
    "hints" : {
      "rt" : "41.54",
      "count" : "175",
      "error" : "0"
    },
    "filter_value" : "4397"
  }, {
    "from_node" : "48",
    "to_node" : "51",
    "direction" : "in",
    "collector" : "Url",
    "target_env_id" : 51,
    "hints" : {
      "rt" : "39.47",
      "count" : "47",
      "error" : "0"
    },
    "filter_value" : "48"
  }, {
    "from_node" : "4396",
    "to_node" : "51",
    "direction" : "in",
    "collector" : "Url",
    "target_env_id" : 51,
    "hints" : {
      "rt" : "36.15",
      "count" : "167",
      "error" : "0"
    },
    "filter_value" : "4396"
  }, {
    "from_node" : "51",
    "to_node" : "Mysql",
    "direction" : "out",
    "collector" : "Mysql",
    "target_env_id" : 51,
    "hints" : {
      "rt" : "1.12",
      "count" : "97402",
      "error" : "14"
    },
    "filter_value" : "Mysql"
  }, {
    "from_node" : "1104",
    "to_node" : "51",
    "direction" : "in",
    "collector" : "Url",
    "target_env_id" : 51,
    "hints" : {
      "rt" : "0.98",
      "count" : "156",
      "error" : "0"
    },
    "filter_value" : "1104"
  }, {
    "from_node" : "913",
    "to_node" : "51",
    "direction" : "in",
    "collector" : "Url",
    "target_env_id" : 51,
    "hints" : {
      "rt" : "64.91",
      "count" : "686",
      "error" : "0"
    },
    "filter_value" : "913"
  }, {
    "from_node" : "3568",
    "to_node" : "51",
    "direction" : "in",
    "collector" : "Url",
    "target_env_id" : 51,
    "hints" : {
      "rt" : "30.67",
      "count" : "563",
      "error" : "0"
    },
    "filter_value" : "3568"
  }, {
    "from_node" : "54",
    "to_node" : "51",
    "direction" : "in",
    "collector" : "Url",
    "target_env_id" : 51,
    "hints" : {
      "rt" : "1.86",
      "count" : "682",
      "error" : "0"
    },
    "filter_value" : "54"
  }, {
    "from_node" : "43",
    "to_node" : "51",
    "direction" : "in",
    "collector" : "Url",
    "target_env_id" : 51,
    "hints" : {
      "rt" : "1.03",
      "count" : "409",
      "error" : "0"
    },
    "filter_value" : "43"
  }, {
    "from_node" : "42",
    "to_node" : "51",
    "direction" : "in",
    "collector" : "Url",
    "target_env_id" : 51,
    "hints" : {
      "rt" : "1.26",
      "count" : "401",
      "error" : "0"
    },
    "filter_value" : "42"
  }, {
    "from_node" : "53",
    "to_node" : "51",
    "direction" : "in",
    "collector" : "Url",
    "target_env_id" : 51,
    "hints" : {
      "rt" : "3.78",
      "count" : "1035",
      "error" : "0"
    },
    "filter_value" : "53"
  }, {
    "from_node" : "45",
    "to_node" : "51",
    "direction" : "in",
    "collector" : "Url",
    "target_env_id" : 51,
    "hints" : {
      "rt" : "31.25",
      "count" : "48",
      "error" : "0"
    },
    "filter_value" : "45"
  }, {
    "from_node" : "55",
    "to_node" : "51",
    "direction" : "in",
    "collector" : "Url",
    "target_env_id" : 51,
    "hints" : {
      "rt" : "1.13",
      "count" : "94",
      "error" : "0"
    },
    "filter_value" : "55"
  } ],
  "collector_config" : {
    "Mysql" : {
      "line_view_config" : {
        "metric_set" : "total",
        "filter_prefix" : null,
        "line_view_item_list" : [ {
          "function" : "SUM(invokeCount)",
          "as" : "count"
        }, {
          "function" : "SUM(totalTime)/SUM(invokeCount)",
          "as" : "rt"
        }, {
          "function" : "SUM(errorCount)",
          "as" : "errorCount"
        } ]
      },
      "detail_view_config" : {
        "metric_set" : "connection",
        "group_by" : "db",
        "detail_view_item_list" : [ {
          "function" : "SUM(invokeCount)",
          "as" : "count"
        }, {
          "function" : "SUM(totalTime)/SUM(invokeCount)",
          "as" : "rt"
        }, {
          "function" : "SUM(errorCount)",
          "as" : "errorCount"
        } ]
      }
    },
    "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" : 1667465696000,
  "real_end_time" : 1667466896000
}

Status Codes

Status Code

Description

200

OK: The request is successful.

401

Unauthorized: No permissions.

403

Forbidden: Access forbidden.

404

Not Found: The requested resource is not found.

Error Codes

See Error Codes.