未验证 提交 250f92d0 编写于 作者: Z zhang-wei 提交者: GitHub

Add source layer and dest layer to relation (#8419)

上级 0d5a289c
...@@ -25,6 +25,7 @@ Release Notes. ...@@ -25,6 +25,7 @@ Release Notes.
* Introduce new concept `Layer` and removed `NodeType`. More details refer to [v9-version-upgrade](https://skywalking.apache.org/docs/main/latest/en/faq/v9-version-upgrade/). * Introduce new concept `Layer` and removed `NodeType`. More details refer to [v9-version-upgrade](https://skywalking.apache.org/docs/main/latest/en/faq/v9-version-upgrade/).
* Fix query sort metrics failure in H2 Storage. * Fix query sort metrics failure in H2 Storage.
* Bump up grpc to 1.43.2 and protobuf to 3.19.2 to fix CVE-2021-22569. * Bump up grpc to 1.43.2 and protobuf to 3.19.2 to fix CVE-2021-22569.
* Add source layer and dest layer to relation.
#### UI #### UI
......
...@@ -157,53 +157,53 @@ This calculates the metrics data from each request of the endpoint in the servic ...@@ -157,53 +157,53 @@ This calculates the metrics data from each request of the endpoint in the servic
This calculates the metrics data from each request between services. This calculates the metrics data from each request between services.
| Name | Remarks | Group Key | Type | | Name | Remarks | Group Key | Type |
|---|---|---|---| |---------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------|-----------|------------------------|
| sourceServiceName | The name of the source service. | | string | | sourceServiceName | The name of the source service. | | string |
| sourceServiceNodeType | The type of node to which the Service or Network address belongs, such as Normal, Database, MQ, or Cache. | | enum | | sourceServiceInstanceName | The name of the source service instance. | | string |
| sourceServiceInstanceName | The name of the source service instance. | | string | | sourceLayer | The layer of the source service. | | enum |
| destServiceName | The name of the destination service. | | string | | destServiceName | The name of the destination service. | | string |
| destServiceNodeType | The type of node of to which the Service or Network address belongs. | | enum | | destServiceInstanceName | The name of the destination service instance. | | string |
| destServiceInstanceName | The name of the destination service instance.| | string| | destLayer | The layer of the destination service. | | enum |
| endpoint | The endpoint used in this call. | | string | endpoint | The endpoint used in this call. | | string |
| componentId | The ID of component used in this call. | yes | string | componentId | The ID of component used in this call. | yes | string |
| latency | The time taken by each request. | | int | | latency | The time taken by each request. | | int |
| status | Indicates the success or failure of the request.| | bool(true for success) | | status | Indicates the success or failure of the request. | | bool(true for success) |
| ~~responseCode~~ | Deprecated.The response code of the HTTP response, and if this request is the HTTP call. E.g. 200, 404, 302| | int | | ~~responseCode~~ | Deprecated.The response code of the HTTP response, and if this request is the HTTP call. E.g. 200, 404, 302 | | int |
| httpResponseStatusCode | The response code of the HTTP response, and if this request is the HTTP call. E.g. 200, 404, 302| | int | | httpResponseStatusCode | The response code of the HTTP response, and if this request is the HTTP call. E.g. 200, 404, 302 | | int |
| rpcStatusCode | The string value of the rpc response code. | | string | | rpcStatusCode | The string value of the rpc response code. | | string |
| type | The type of each request, such as Database, HTTP, RPC, or gRPC. | | enum | | type | The type of each request, such as Database, HTTP, RPC, or gRPC. | | enum |
| detectPoint | Where the relation is detected. The value may be client, server, or proxy. | yes | enum| | detectPoint | Where the relation is detected. The value may be client, server, or proxy. | yes | enum |
| tlsMode | The TLS mode between source and destination services, such as `service_relation_mtls_cpm = from(ServiceRelation.*).filter(tlsMode == "mTLS").cpm()` || string| | tlsMode | The TLS mode between source and destination services, such as `service_relation_mtls_cpm = from(ServiceRelation.*).filter(tlsMode == "mTLS").cpm()` | | string |
| sideCar.internalErrorCode | The sidecar/gateway proxy internal error code. The value is based on the implementation. | | string| | sideCar.internalErrorCode | The sidecar/gateway proxy internal error code. The value is based on the implementation. | | string |
| tcpInfo.receivedBytes | The received bytes of the TCP traffic, if this request is a TCP call. | | long | | tcpInfo.receivedBytes | The received bytes of the TCP traffic, if this request is a TCP call. | | long |
| tcpInfo.sentBytes | The sent bytes of the TCP traffic, if this request is a TCP call. | | long | | tcpInfo.sentBytes | The sent bytes of the TCP traffic, if this request is a TCP call. | | long |
### SCOPE `ServiceInstanceRelation` ### SCOPE `ServiceInstanceRelation`
This calculates the metrics data from each request between service instances. This calculates the metrics data from each request between service instances.
| Name | Remarks | Group Key | Type | | Name | Remarks | Group Key | Type |
|---|---|---|---| |---------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------|------------------------|
| sourceServiceName | The name of the source service. | | string | | sourceServiceName | The name of the source service. | | string |
| sourceServiceNodeType | The type of node to which the Service or Network address belongs, such as Normal, Database, MQ, or Cache. | | enum | | sourceServiceInstanceName | The name of the source service instance. | | string |
| sourceServiceInstanceName | The name of the source service instance. | | string | | sourceServiceLayer | The layer of the source service. | | enum |
| destServiceName | The name of the destination service. | | | | destServiceName | The name of the destination service. | | |
| destServiceNodeType | The type of node to which the Service or Network address belongs, such as Normal, Database, MQ, or Cache. | | string | | destServiceInstanceName | The name of the destination service instance. | | string |
| destServiceInstanceName | The name of the destination service instance. | | string | | destServiceLayer | The layer of the destination service. | | enum |
| endpoint | The endpoint used in this call. | | string | endpoint | The endpoint used in this call. | | string |
| componentId | The ID of the component used in this call. | yes | string | componentId | The ID of the component used in this call. | yes | string |
| latency | The time taken by each request. | | int | | latency | The time taken by each request. | | int |
| status | Indicates the success or failure of the request.| | bool(true for success) | | status | Indicates the success or failure of the request. | | bool(true for success) |
| ~~responseCode~~ | Deprecated.The response code of the HTTP response, and if this request is the HTTP call. E.g. 200, 404, 302| | int | | ~~responseCode~~ | Deprecated.The response code of the HTTP response, and if this request is the HTTP call. E.g. 200, 404, 302 | | int |
| httpResponseStatusCode | The response code of the HTTP response, and if this request is the HTTP call. E.g. 200, 404, 302| | int | | httpResponseStatusCode | The response code of the HTTP response, and if this request is the HTTP call. E.g. 200, 404, 302 | | int |
| rpcStatusCode | The string value of the rpc response code. | | string | | rpcStatusCode | The string value of the rpc response code. | | string |
| type | The type of each request, such as Database, HTTP, RPC, or gRPC. | | enum | | type | The type of each request, such as Database, HTTP, RPC, or gRPC. | | enum |
| detectPoint | Where the relation is detected. The value may be client, server, or proxy. | yes | enum| | detectPoint | Where the relation is detected. The value may be client, server, or proxy. | yes | enum |
| tlsMode | The TLS mode between source and destination service instances, such as `service_instance_relation_mtls_cpm = from(ServiceInstanceRelation.*).filter(tlsMode == "mTLS").cpm()` || string| | tlsMode | The TLS mode between source and destination service instances, such as `service_instance_relation_mtls_cpm = from(ServiceInstanceRelation.*).filter(tlsMode == "mTLS").cpm()` || string | |
| sideCar.internalErrorCode | The sidecar/gateway proxy internal error code. The value is based on the implementation. | | string| | sideCar.internalErrorCode | The sidecar/gateway proxy internal error code. The value is based on the implementation. | | string |
| tcpInfo.receivedBytes | The received bytes of the TCP traffic, if this request is a TCP call. | | long | | tcpInfo.receivedBytes | The received bytes of the TCP traffic, if this request is a TCP call. | | long |
| tcpInfo.sentBytes | The sent bytes of the TCP traffic, if this request is a TCP call. | | long | | tcpInfo.sentBytes | The sent bytes of the TCP traffic, if this request is a TCP call. | | long |
### SCOPE `EndpointRelation` ### SCOPE `EndpointRelation`
......
...@@ -130,6 +130,7 @@ public class MultiScopesAnalysisListener implements EntryAnalysisListener, ExitA ...@@ -130,6 +130,7 @@ public class MultiScopesAnalysisListener implements EntryAnalysisListener, ExitA
sourceBuilder.setSourceServiceName(Const.USER_SERVICE_NAME); sourceBuilder.setSourceServiceName(Const.USER_SERVICE_NAME);
sourceBuilder.setSourceServiceInstanceName(Const.USER_INSTANCE_NAME); sourceBuilder.setSourceServiceInstanceName(Const.USER_INSTANCE_NAME);
sourceBuilder.setSourceEndpointName(Const.USER_ENDPOINT_NAME); sourceBuilder.setSourceEndpointName(Const.USER_ENDPOINT_NAME);
sourceBuilder.setSourceLayer(Layer.UNDEFINED);
sourceBuilder.setSourceNormal(false); sourceBuilder.setSourceNormal(false);
sourceBuilder.setDestServiceInstanceName(segmentObject.getServiceInstance()); sourceBuilder.setDestServiceInstanceName(segmentObject.getServiceInstance());
sourceBuilder.setDestServiceName(segmentObject.getService()); sourceBuilder.setDestServiceName(segmentObject.getService());
...@@ -164,6 +165,7 @@ public class MultiScopesAnalysisListener implements EntryAnalysisListener, ExitA ...@@ -164,6 +165,7 @@ public class MultiScopesAnalysisListener implements EntryAnalysisListener, ExitA
sourceBuilder.setSourceServiceName(segmentObject.getService()); sourceBuilder.setSourceServiceName(segmentObject.getService());
sourceBuilder.setSourceServiceInstanceName(segmentObject.getServiceInstance()); sourceBuilder.setSourceServiceInstanceName(segmentObject.getServiceInstance());
sourceBuilder.setSourceLayer(Layer.GENERAL);
final NetworkAddressAlias networkAddressAlias = networkAddressAliasCache.get(networkAddress); final NetworkAddressAlias networkAddressAlias = networkAddressAliasCache.get(networkAddress);
if (networkAddressAlias == null) { if (networkAddressAlias == null) {
......
...@@ -175,9 +175,11 @@ class SourceBuilder { ...@@ -175,9 +175,11 @@ class SourceBuilder {
serviceRelation.setSourceServiceName(sourceServiceName); serviceRelation.setSourceServiceName(sourceServiceName);
serviceRelation.setSourceNormal(isSourceNormal); serviceRelation.setSourceNormal(isSourceNormal);
serviceRelation.setSourceServiceInstanceName(sourceServiceInstanceName); serviceRelation.setSourceServiceInstanceName(sourceServiceInstanceName);
serviceRelation.setSourceLayer(sourceLayer);
serviceRelation.setDestServiceName(destServiceName); serviceRelation.setDestServiceName(destServiceName);
serviceRelation.setDestNormal(isDestNormal); serviceRelation.setDestNormal(isDestNormal);
serviceRelation.setDestServiceInstanceName(destServiceInstanceName); serviceRelation.setDestServiceInstanceName(destServiceInstanceName);
serviceRelation.setDestLayer(destLayer);
serviceRelation.setEndpoint(destEndpointName); serviceRelation.setEndpoint(destEndpointName);
serviceRelation.setComponentId(componentId); serviceRelation.setComponentId(componentId);
serviceRelation.setLatency(latency); serviceRelation.setLatency(latency);
...@@ -225,9 +227,11 @@ class SourceBuilder { ...@@ -225,9 +227,11 @@ class SourceBuilder {
serviceInstanceRelation.setSourceServiceName(sourceServiceName); serviceInstanceRelation.setSourceServiceName(sourceServiceName);
serviceInstanceRelation.setSourceServiceNormal(isSourceNormal); serviceInstanceRelation.setSourceServiceNormal(isSourceNormal);
serviceInstanceRelation.setSourceServiceInstanceName(sourceServiceInstanceName); serviceInstanceRelation.setSourceServiceInstanceName(sourceServiceInstanceName);
serviceInstanceRelation.setSourceServiceLayer(sourceLayer);
serviceInstanceRelation.setDestServiceName(destServiceName); serviceInstanceRelation.setDestServiceName(destServiceName);
serviceInstanceRelation.setDestServiceNormal(isDestNormal); serviceInstanceRelation.setDestServiceNormal(isDestNormal);
serviceInstanceRelation.setDestServiceInstanceName(destServiceInstanceName); serviceInstanceRelation.setDestServiceInstanceName(destServiceInstanceName);
serviceInstanceRelation.setDestServiceLayer(destLayer);
serviceInstanceRelation.setEndpoint(destEndpointName); serviceInstanceRelation.setEndpoint(destEndpointName);
serviceInstanceRelation.setComponentId(componentId); serviceInstanceRelation.setComponentId(componentId);
serviceInstanceRelation.setLatency(latency); serviceInstanceRelation.setLatency(latency);
......
...@@ -20,6 +20,7 @@ package org.apache.skywalking.oap.server.core.source; ...@@ -20,6 +20,7 @@ package org.apache.skywalking.oap.server.core.source;
import lombok.Getter; import lombok.Getter;
import lombok.Setter; import lombok.Setter;
import org.apache.skywalking.oap.server.core.analysis.Layer;
import org.apache.skywalking.oap.server.library.util.StringUtil; import org.apache.skywalking.oap.server.library.util.StringUtil;
import org.apache.skywalking.oap.server.core.analysis.IDManager; import org.apache.skywalking.oap.server.core.analysis.IDManager;
...@@ -57,6 +58,9 @@ public class ServiceInstanceRelation extends Source { ...@@ -57,6 +58,9 @@ public class ServiceInstanceRelation extends Source {
@Setter @Setter
@ScopeDefaultColumn.DefinedByField(columnName = "source_service_name", requireDynamicActive = true) @ScopeDefaultColumn.DefinedByField(columnName = "source_service_name", requireDynamicActive = true)
private String sourceServiceName; private String sourceServiceName;
@Getter
@Setter
private Layer sourceServiceLayer;
@Setter @Setter
private boolean isSourceServiceNormal; private boolean isSourceServiceNormal;
@Getter @Getter
...@@ -67,6 +71,9 @@ public class ServiceInstanceRelation extends Source { ...@@ -67,6 +71,9 @@ public class ServiceInstanceRelation extends Source {
private String destServiceInstanceId; private String destServiceInstanceId;
@Getter @Getter
private String destServiceId; private String destServiceId;
@Getter
@Setter
private Layer destServiceLayer;
@Setter @Setter
private boolean isDestServiceNormal; private boolean isDestServiceNormal;
@Getter @Getter
......
...@@ -20,6 +20,7 @@ package org.apache.skywalking.oap.server.core.source; ...@@ -20,6 +20,7 @@ package org.apache.skywalking.oap.server.core.source;
import lombok.Getter; import lombok.Getter;
import lombok.Setter; import lombok.Setter;
import org.apache.skywalking.oap.server.core.analysis.Layer;
import org.apache.skywalking.oap.server.library.util.StringUtil; import org.apache.skywalking.oap.server.library.util.StringUtil;
import org.apache.skywalking.oap.server.core.analysis.IDManager; import org.apache.skywalking.oap.server.core.analysis.IDManager;
...@@ -61,11 +62,17 @@ public class ServiceRelation extends Source { ...@@ -61,11 +62,17 @@ public class ServiceRelation extends Source {
@Setter @Setter
private String sourceServiceInstanceName; private String sourceServiceInstanceName;
@Getter @Getter
@Setter
private Layer sourceLayer;
@Getter
private String destServiceId; private String destServiceId;
@Getter @Getter
@Setter @Setter
@ScopeDefaultColumn.DefinedByField(columnName = "dest_name", requireDynamicActive = true) @ScopeDefaultColumn.DefinedByField(columnName = "dest_name", requireDynamicActive = true)
private String destServiceName; private String destServiceName;
@Getter
@Setter
private Layer destLayer;
@Setter @Setter
private boolean isDestNormal; private boolean isDestNormal;
@Getter @Getter
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册