docs/en/concepts-and-designs/service-hierarchy.md
SkyWalking v10 introduces a new concept Service Hierarchy which defines the relationships of existing logically same services in various layers.
OAP will detect the services from different layers, and try to build the connections.
There 2 ways to detect the connections:
Note: All the relationships and auto-matching rules should be defined in the config/hierarchy-definition.yml file.
If you want to customize it according to your own needs, please refer to Service Hierarchy Configuration.
| Upper layer | Lower layer | Matching rule |
|---|---|---|
| GENERAL | K8S_SERVICE | GENERAL On K8S_SERVICE |
| GENERAL | APISIX | GENERAL On APISIX |
| VIRTUAL_DATABASE | MYSQL | VIRTUAL_DATABASE On MYSQL |
| VIRTUAL_DATABASE | POSTGRESQL | VIRTUAL_DATABASE On POSTGRESQL |
| VIRTUAL_DATABASE | CLICKHOUSE | VIRTUAL_DATABASE On CLICKHOUSE |
| VIRTUAL_MQ | RABBITMQ | VIRTUAL_MQ On RABBITMQ |
| VIRTUAL_MQ | ROCKETMQ | VIRTUAL_MQ On K8S_SERVICE |
| VIRTUAL_MQ | KAFKA | VIRTUAL_MQ On KAFKA |
| VIRTUAL_MQ | RABBITMQ | VIRTUAL_MQ On RABBITMQ |
| VIRTUAL_MQ | PULSAR | VIRTUAL_MQ On PULSAR |
| MESH | MESH_DP | MESH On MESH_DP |
| MESH | K8S_SERVICE | MESH On K8S_SERVICE |
| MESH_DP | K8S_SERVICE | MESH_DP On K8S_SERVICE |
| MYSQL | K8S_SERVICE | MYSQL On K8S_SERVICE |
| POSTGRESQL | K8S_SERVICE | POSTGRESQL On K8S_SERVICE |
| CLICKHOUSE | K8S_SERVICE | CLICKHOUSE On K8S_SERVICE |
| NGINX | K8S_SERVICE | NGINX On K8S_SERVICE |
| APISIX | K8S_SERVICE | APISIX On K8S_SERVICE |
| ROCKETMQ | K8S_SERVICE | ROCKETMQ On K8S_SERVICE |
| RABBITMQ | K8S_SERVICE | RABBITMQ On K8S_SERVICE |
| KAFKA | K8S_SERVICE | KAFKA On K8S_SERVICE |
| PULSAR | K8S_SERVICE | PULSAR On K8S_SERVICE |
| SO11Y_OAP | K8S_SERVICE | SO11Y_OAP On K8S_SERVICE |
| KONG | K8S_SERVICE | KONG On K8S_SERVICE |
upper-layer On lower-layer format.group and short name with :: separator.lower-short-name-remove-ns{ (u, l) -> u.shortName == l.shortName.substring(0, l.shortName.lastIndexOf('.')) }agent::songsskywalking-showcase::songs.sample-serviceslower-short-name-remove-ns{ (u, l) -> u.shortName == l.shortName.substring(0, l.shortName.lastIndexOf('.')) }agent::frontendAPISIX::frontend.sample-serviceslower-short-name-with-fqdn{ (u, l) -> u.shortName.substring(0, u.shortName.lastIndexOf(':')) == l.shortName.concat('.svc.cluster.local') }mysql.skywalking-showcase.svc.cluster.local:3306mysql::mysql.skywalking-showcaselower-short-name-with-fqdn{ (u, l) -> u.shortName.substring(0, u.shortName.lastIndexOf(':')) == l.shortName.concat('.svc.cluster.local') }psql.skywalking-showcase.svc.cluster.local:5432postgresql::psql.skywalking-showcaselower-short-name-with-fqdn{ (u, l) -> u.shortName.substring(0, u.shortName.lastIndexOf(':')) == l.shortName.concat('.svc.cluster.local') }clickhouse.skywalking-showcase.svc.cluster.local:8123clickhouse::clickhouse.skywalking-showcaselower-short-name-with-fqdn{ (u, l) -> u.shortName.substring(0, u.shortName.lastIndexOf(':')) == l.shortName.concat('.svc.cluster.local') }rocketmq.skywalking-showcase.svc.cluster.local:9876rocketmq::rocketmq.skywalking-showcaselower-short-name-with-fqdn{ (u, l) -> u.shortName.substring(0, u.shortName.lastIndexOf(':')) == l.shortName.concat('.svc.cluster.local') }rabbitmq.skywalking-showcase.svc.cluster.local:5672rabbitmq::rabbitmq.skywalking-showcaselower-short-name-with-fqdn{ (u, l) -> u.shortName.substring(0, u.shortName.lastIndexOf(':')) == l.shortName.concat('.svc.cluster.local') }kafka.skywalking-showcase.svc.cluster.local:9092kafka::rocketmq.skywalking-showcaselower-short-name-with-fqdn{ (u, l) -> u.shortName.substring(0, u.shortName.lastIndexOf(':')) == l.shortName.concat('.svc.cluster.local') }pulsar.skywalking-showcase.svc.cluster.local:6650pulsar::pulsar.skywalking-showcasename{ (u, l) -> u.name == l.name }mesh-svr::songs.sample-servicesmesh-svr::songs.sample-servicesshort-name{ (u, l) -> u.shortName == l.shortName }mesh-svr::songs.sample-servicesskywalking-showcase::songs.sample-servicesshort-name{ (u, l) -> u.shortName == l.shortName }mesh-svr::songs.sample-servicesskywalking-showcase::songs.sample-servicesshort-name{ (u, l) -> u.shortName == l.shortName }mysql::mysql.skywalking-showcaseskywalking-showcase::mysql.skywalking-showcaseshort-name{ (u, l) -> u.shortName == l.shortName }postgresql::psql.skywalking-showcaseskywalking-showcase::psql.skywalking-showcaseshort-name{ (u, l) -> u.shortName == l.shortName }clickhouse::clickhouse.skywalking-showcaseskywalking-showcase::clickhouse.skywalking-showcaseshort-name{ (u, l) -> u.shortName == l.shortName }nginx::nginx.skywalking-showcaseskywalking-showcase::nginx.skywalking-showcaseshort-name{ (u, l) -> u.shortName == l.shortName }APISIX::frontend.sample-servicesskywalking-showcase::frontend.sample-servicesshort-name{ (u, l) -> u.shortName == l.shortName }rocketmq::rocketmq.skywalking-showcaseskywalking-showcase::rocketmq.skywalking-showcaseshort-name{ (u, l) -> u.shortName == l.shortName }rabbitmq::rabbitmq.skywalking-showcaseskywalking-showcase::rabbitmq.skywalking-showcaseshort-name{ (u, l) -> u.shortName == l.shortName }kafka::kafka.skywalking-showcaseskywalking-showcase::kafka.skywalking-showcaseshort-name{ (u, l) -> u.shortName == l.shortName }pulsar::pulsar.skywalking-showcaseskywalking-showcase::pulsar.skywalking-showcaseshort-name{ (u, l) -> u.shortName == l.shortName }demo-oap.skywalking-showcaseskywalking-showcase::demo-oap.skywalking-showcaseshort-name{ (u, l) -> u.shortName == l.shortName }kong::kong.skywalking-showcaseskywalking-showcase::kong.skywalking-showcaseUse agent tech involved(such as eBPF) and deployment tools(such as operator and agent injector) to detect the service hierarchy relations.
| Upper layer | Lower layer | Agent |
|---|
Instance Hierarchy relationship follows the same definition as Service Hierarchy.
If the service hierarchy is built, the instance hierarchy relationship could be detected automatically through the following rules:
pod/hostname equals the lower instance attribute pod/hostname.pod/hostname equals the lower instance name.pod/hostname.