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

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

上级 0d5a289c
......@@ -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/).
* 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.
* Add source layer and dest layer to relation.
#### UI
......
......@@ -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.
| Name | Remarks | Group Key | Type |
|---|---|---|---|
| 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 |
| 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|
| endpoint | The endpoint used in this call. | | string
| componentId | The ID of component used in this call. | yes | string
| latency | The time taken by each request. | | int |
| 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 |
| 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 |
| 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|
| 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|
| 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 |
| Name | Remarks | Group Key | Type |
|---------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------|-----------|------------------------|
| sourceServiceName | The name of the source service. | | 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 |
| 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 |
| componentId | The ID of component used in this call. | yes | string |
| latency | The time taken by each request. | | int |
| 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 |
| 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 |
| 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 |
| 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 |
| 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 |
### SCOPE `ServiceInstanceRelation`
This calculates the metrics data from each request between service instances.
| Name | Remarks | Group Key | Type |
|---|---|---|---|
| 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 |
| 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 |
| endpoint | The endpoint used in this call. | | string
| componentId | The ID of the component used in this call. | yes | string
| latency | The time taken by each request. | | int |
| 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 |
| 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 |
| 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|
| 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|
| 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 |
| Name | Remarks | Group Key | Type |
|---------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------|------------------------|
| sourceServiceName | The name of the source service. | | 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. | | |
| 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 |
| componentId | The ID of the component used in this call. | yes | string |
| latency | The time taken by each request. | | int |
| 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 |
| 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 |
| 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 |
| 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 |
| 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 |
### SCOPE `EndpointRelation`
......
......@@ -130,6 +130,7 @@ public class MultiScopesAnalysisListener implements EntryAnalysisListener, ExitA
sourceBuilder.setSourceServiceName(Const.USER_SERVICE_NAME);
sourceBuilder.setSourceServiceInstanceName(Const.USER_INSTANCE_NAME);
sourceBuilder.setSourceEndpointName(Const.USER_ENDPOINT_NAME);
sourceBuilder.setSourceLayer(Layer.UNDEFINED);
sourceBuilder.setSourceNormal(false);
sourceBuilder.setDestServiceInstanceName(segmentObject.getServiceInstance());
sourceBuilder.setDestServiceName(segmentObject.getService());
......@@ -164,6 +165,7 @@ public class MultiScopesAnalysisListener implements EntryAnalysisListener, ExitA
sourceBuilder.setSourceServiceName(segmentObject.getService());
sourceBuilder.setSourceServiceInstanceName(segmentObject.getServiceInstance());
sourceBuilder.setSourceLayer(Layer.GENERAL);
final NetworkAddressAlias networkAddressAlias = networkAddressAliasCache.get(networkAddress);
if (networkAddressAlias == null) {
......
......@@ -175,9 +175,11 @@ class SourceBuilder {
serviceRelation.setSourceServiceName(sourceServiceName);
serviceRelation.setSourceNormal(isSourceNormal);
serviceRelation.setSourceServiceInstanceName(sourceServiceInstanceName);
serviceRelation.setSourceLayer(sourceLayer);
serviceRelation.setDestServiceName(destServiceName);
serviceRelation.setDestNormal(isDestNormal);
serviceRelation.setDestServiceInstanceName(destServiceInstanceName);
serviceRelation.setDestLayer(destLayer);
serviceRelation.setEndpoint(destEndpointName);
serviceRelation.setComponentId(componentId);
serviceRelation.setLatency(latency);
......@@ -225,9 +227,11 @@ class SourceBuilder {
serviceInstanceRelation.setSourceServiceName(sourceServiceName);
serviceInstanceRelation.setSourceServiceNormal(isSourceNormal);
serviceInstanceRelation.setSourceServiceInstanceName(sourceServiceInstanceName);
serviceInstanceRelation.setSourceServiceLayer(sourceLayer);
serviceInstanceRelation.setDestServiceName(destServiceName);
serviceInstanceRelation.setDestServiceNormal(isDestNormal);
serviceInstanceRelation.setDestServiceInstanceName(destServiceInstanceName);
serviceInstanceRelation.setDestServiceLayer(destLayer);
serviceInstanceRelation.setEndpoint(destEndpointName);
serviceInstanceRelation.setComponentId(componentId);
serviceInstanceRelation.setLatency(latency);
......
......@@ -20,6 +20,7 @@ package org.apache.skywalking.oap.server.core.source;
import lombok.Getter;
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.core.analysis.IDManager;
......@@ -57,6 +58,9 @@ public class ServiceInstanceRelation extends Source {
@Setter
@ScopeDefaultColumn.DefinedByField(columnName = "source_service_name", requireDynamicActive = true)
private String sourceServiceName;
@Getter
@Setter
private Layer sourceServiceLayer;
@Setter
private boolean isSourceServiceNormal;
@Getter
......@@ -67,6 +71,9 @@ public class ServiceInstanceRelation extends Source {
private String destServiceInstanceId;
@Getter
private String destServiceId;
@Getter
@Setter
private Layer destServiceLayer;
@Setter
private boolean isDestServiceNormal;
@Getter
......
......@@ -20,6 +20,7 @@ package org.apache.skywalking.oap.server.core.source;
import lombok.Getter;
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.core.analysis.IDManager;
......@@ -61,11 +62,17 @@ public class ServiceRelation extends Source {
@Setter
private String sourceServiceInstanceName;
@Getter
@Setter
private Layer sourceLayer;
@Getter
private String destServiceId;
@Getter
@Setter
@ScopeDefaultColumn.DefinedByField(columnName = "dest_name", requireDynamicActive = true)
private String destServiceName;
@Getter
@Setter
private Layer destLayer;
@Setter
private boolean isDestNormal;
@Getter
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册