SkyWalking v10 introduces a new concept Service Hierarchy which defines the relationships of existing logically same services in various layers. The concept and design could be found here.
All the relationships defined in the config/hierarchy-definition.yml file. You can customize it according to your own needs. Here is an example:
hierarchy: MESH: MESH_DP: name K8S_SERVICE: short-name MESH_DP: K8S_SERVICE: short-name GENERAL: K8S_SERVICE: lower-short-name-remove-ns MYSQL: K8S_SERVICE: short-name POSTGRESQL: K8S_SERVICE: short-name SO11Y_OAP: K8S_SERVICE: short-name VIRTUAL_DATABASE: MYSQL: lower-short-name-with-fqdn POSTGRESQL: lower-short-name-with-fqdn auto-matching-rules: # the name of the upper service is equal to the name of the lower service name: "{ (u, l) -> u.name == l.name }" # the short name of the upper service is equal to the short name of the lower service short-name: "{ (u, l) -> u.shortName == l.shortName }" # remove the k8s namespace from the lower service short name # this rule is only works on k8s env. lower-short-name-remove-ns: "{ (u, l) -> { if(l.shortName.lastIndexOf('.') > 0) return u.shortName == l.shortName.substring(0, l.shortName.lastIndexOf('.')); return false; } }" # the short name of the upper remove port is equal to the short name of the lower service with fqdn suffix # this rule is only works on k8s env. lower-short-name-with-fqdn: "{ (u, l) -> { if(u.shortName.lastIndexOf(':') > 0) return u.shortName.substring(0, u.shortName.lastIndexOf(':')) == l.shortName.concat('.svc.cluster.local'); return false; } }" layer-levels: # The hierarchy level of the service layer, the level is used to define the order of the service layer for UI presentation. # The level of the upper service should greater than the level of the lower service in `hierarchy` section. MESH: 3 GENERAL: 3 SO11Y_OAP: 3 VIRTUAL_DATABASE: 3 MYSQL: 2 POSTGRESQL: 2 MESH_DP: 1 CILIUM_SERVICE: 1 K8S_SERVICE: 0
hierarchy section.auto-matching-rules section.org.apache.skywalking.oap.server.core.analysis.Layers.java.auto-matching-rules section.layer-levels section.hierarchy section.