Insure span analyze isNormal and Layer consistent. (#8724)
This commit is contained in:
parent
ba9cad6d8f
commit
0dfb93a2d1
|
|
@ -103,14 +103,17 @@ public class MultiScopesAnalysisListener implements EntryAnalysisListener, ExitA
|
|||
}
|
||||
|
||||
final String networkAddressUsedAtPeer = reference.getNetworkAddressUsedAtPeer();
|
||||
|
||||
if (span.getSpanLayer().equals(SpanLayer.MQ) ||
|
||||
config.getUninstrumentedGatewaysConfig().isAddressConfiguredAsGateway(networkAddressUsedAtPeer)) {
|
||||
boolean isMQ = span.getSpanLayer().equals(SpanLayer.MQ);
|
||||
if (isMQ || config.getUninstrumentedGatewaysConfig()
|
||||
.isAddressConfiguredAsGateway(networkAddressUsedAtPeer)) {
|
||||
sourceBuilder.setSourceServiceName(networkAddressUsedAtPeer);
|
||||
sourceBuilder.setSourceEndpointOwnerServiceName(reference.getParentService());
|
||||
sourceBuilder.setSourceServiceInstanceName(networkAddressUsedAtPeer);
|
||||
sourceBuilder.setSourceLayer(Layer.VIRTUAL_MQ);
|
||||
sourceBuilder.setSourceNormal(false);
|
||||
if (isMQ) {
|
||||
sourceBuilder.setSourceLayer(Layer.VIRTUAL_MQ);
|
||||
} else {
|
||||
sourceBuilder.setSourceLayer(Layer.VIRTUAL_GATEWAY);
|
||||
}
|
||||
} else {
|
||||
sourceBuilder.setSourceServiceName(reference.getParentService());
|
||||
sourceBuilder.setSourceServiceInstanceName(reference.getParentServiceInstance());
|
||||
|
|
@ -131,7 +134,6 @@ public class MultiScopesAnalysisListener implements EntryAnalysisListener, ExitA
|
|||
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());
|
||||
sourceBuilder.setDestLayer(identifyServiceLayer(span.getSpanLayer()));
|
||||
|
|
@ -171,8 +173,7 @@ public class MultiScopesAnalysisListener implements EntryAnalysisListener, ExitA
|
|||
if (networkAddressAlias == null) {
|
||||
sourceBuilder.setDestServiceName(networkAddress);
|
||||
sourceBuilder.setDestServiceInstanceName(networkAddress);
|
||||
sourceBuilder.setDestLayer(identifyRemoteServiceLayer(span.getSpanLayer()));
|
||||
sourceBuilder.setDestNormal(false);
|
||||
sourceBuilder.setDestLayer(identifyRemoteServiceLayer(span.getSpanLayer(), span.getPeer()));
|
||||
} else {
|
||||
/*
|
||||
* If alias exists, mean this network address is representing a real service.
|
||||
|
|
@ -378,7 +379,7 @@ public class MultiScopesAnalysisListener implements EntryAnalysisListener, ExitA
|
|||
/**
|
||||
* Identify the layer of remote service. Such as ${@link Layer#DATABASE} and ${@link Layer#CACHE}.
|
||||
*/
|
||||
private Layer identifyRemoteServiceLayer(SpanLayer spanLayer) {
|
||||
private Layer identifyRemoteServiceLayer(SpanLayer spanLayer, String peer) {
|
||||
switch (spanLayer) {
|
||||
case Unknown:
|
||||
return Layer.UNDEFINED;
|
||||
|
|
@ -387,6 +388,9 @@ public class MultiScopesAnalysisListener implements EntryAnalysisListener, ExitA
|
|||
case RPCFramework:
|
||||
return Layer.GENERAL;
|
||||
case Http:
|
||||
if (config.getUninstrumentedGatewaysConfig().isAddressConfiguredAsGateway(peer)) {
|
||||
return Layer.VIRTUAL_GATEWAY;
|
||||
}
|
||||
return Layer.GENERAL;
|
||||
case MQ:
|
||||
return Layer.MQ;
|
||||
|
|
|
|||
|
|
@ -52,9 +52,6 @@ class SourceBuilder {
|
|||
private Layer sourceLayer;
|
||||
@Getter
|
||||
@Setter
|
||||
private boolean isSourceNormal = true;
|
||||
@Getter
|
||||
@Setter
|
||||
private String sourceServiceInstanceName;
|
||||
/**
|
||||
* Source endpoint could be not owned by {@link #sourceServiceName}, such as in the MQ or un-instrumented proxy
|
||||
|
|
@ -74,9 +71,6 @@ class SourceBuilder {
|
|||
private Layer destLayer;
|
||||
@Getter
|
||||
@Setter
|
||||
private boolean isDestNormal = true;
|
||||
@Getter
|
||||
@Setter
|
||||
private String destServiceInstanceName;
|
||||
@Getter
|
||||
@Setter
|
||||
|
|
@ -133,7 +127,6 @@ class SourceBuilder {
|
|||
service.setServiceInstanceName(destServiceInstanceName);
|
||||
service.setEndpointName(destEndpointName);
|
||||
service.setLayer(destLayer);
|
||||
service.setNormal(isDestNormal);
|
||||
service.setLatency(latency);
|
||||
service.setStatus(status);
|
||||
service.setResponseCode(responseCode);
|
||||
|
|
@ -152,11 +145,9 @@ class SourceBuilder {
|
|||
ServiceRelation toServiceRelation() {
|
||||
ServiceRelation serviceRelation = new ServiceRelation();
|
||||
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);
|
||||
|
|
@ -180,7 +171,6 @@ class SourceBuilder {
|
|||
ServiceInstance serviceInstance = new ServiceInstance();
|
||||
serviceInstance.setName(destServiceInstanceName);
|
||||
serviceInstance.setServiceName(destServiceName);
|
||||
serviceInstance.setServiceNormal(isDestNormal);
|
||||
serviceInstance.setLayer(destLayer);
|
||||
serviceInstance.setEndpointName(destEndpointName);
|
||||
serviceInstance.setLatency(latency);
|
||||
|
|
@ -204,11 +194,9 @@ class SourceBuilder {
|
|||
}
|
||||
ServiceInstanceRelation serviceInstanceRelation = new ServiceInstanceRelation();
|
||||
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);
|
||||
|
|
@ -231,7 +219,7 @@ class SourceBuilder {
|
|||
Endpoint endpoint = new Endpoint();
|
||||
endpoint.setName(destEndpointName);
|
||||
endpoint.setServiceName(destServiceName);
|
||||
endpoint.setServiceNormal(isDestNormal);
|
||||
endpoint.setServiceLayer(destLayer);
|
||||
endpoint.setServiceInstanceName(destServiceInstanceName);
|
||||
endpoint.setLatency(latency);
|
||||
endpoint.setStatus(status);
|
||||
|
|
@ -256,15 +244,15 @@ class SourceBuilder {
|
|||
endpointRelation.setEndpoint(sourceEndpointName);
|
||||
if (sourceEndpointOwnerServiceName == null) {
|
||||
endpointRelation.setServiceName(sourceServiceName);
|
||||
endpointRelation.setServiceNormal(isSourceNormal);
|
||||
endpointRelation.setServiceLayer(sourceLayer);
|
||||
} else {
|
||||
endpointRelation.setServiceName(sourceEndpointOwnerServiceName);
|
||||
endpointRelation.setServiceNormal(true);
|
||||
endpointRelation.setServiceLayer(Layer.GENERAL);
|
||||
}
|
||||
endpointRelation.setServiceInstanceName(sourceServiceInstanceName);
|
||||
endpointRelation.setChildEndpoint(destEndpointName);
|
||||
endpointRelation.setChildServiceName(destServiceName);
|
||||
endpointRelation.setChildServiceNormal(isDestNormal);
|
||||
endpointRelation.setChildServiceLayer(destLayer);
|
||||
endpointRelation.setChildServiceInstanceName(destServiceInstanceName);
|
||||
endpointRelation.setComponentId(componentId);
|
||||
endpointRelation.setRpcLatency(latency);
|
||||
|
|
@ -286,7 +274,7 @@ class SourceBuilder {
|
|||
ServiceMeta service = new ServiceMeta();
|
||||
service.setName(destServiceName);
|
||||
service.setLayer(destLayer);
|
||||
service.setNormal(isDestNormal);
|
||||
service.setLayer(destLayer);
|
||||
service.setTimeBucket(timeBucket);
|
||||
return service;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -73,10 +73,9 @@ public class TrafficAnalysisListener implements LogAnalysisListener {
|
|||
final long timeBucket = TimeBucket.getTimeBucket(System.currentTimeMillis(), DownSampling.Minute);
|
||||
// to service traffic
|
||||
String serviceName = namingControl.formatServiceName(logData.getService());
|
||||
String serviceId = IDManager.ServiceID.buildId(serviceName, true);
|
||||
String serviceId = IDManager.ServiceID.buildId(serviceName, layer.isNormal());
|
||||
serviceMeta = new ServiceMeta();
|
||||
serviceMeta.setName(namingControl.formatServiceName(logData.getService()));
|
||||
serviceMeta.setNormal(true);
|
||||
serviceMeta.setLayer(layer);
|
||||
serviceMeta.setTimeBucket(timeBucket);
|
||||
// to service instance traffic
|
||||
|
|
|
|||
|
|
@ -298,7 +298,6 @@ public class Analyzer {
|
|||
private void toService(String serviceName, Layer layer) {
|
||||
ServiceTraffic s = new ServiceTraffic();
|
||||
s.setName(requireNonNull(serviceName));
|
||||
s.setNormal(true);
|
||||
s.setTimeBucket(TimeBucket.getMinuteTimeBucket(System.currentTimeMillis()));
|
||||
s.setLayer(layer);
|
||||
MetricsStreamProcessor.getInstance().in(s);
|
||||
|
|
|
|||
|
|
@ -25,99 +25,110 @@ import java.util.stream.Collectors;
|
|||
import org.apache.skywalking.oap.server.core.UnexpectedException;
|
||||
|
||||
/**
|
||||
* Layer represents an abstract framework in computer science, such as Operating System(OS_LINUX layer),
|
||||
* Kubernetes(k8s layer). This kind of layer would be owners of different services/instances detected from different technology.
|
||||
* Layer represents an abstract framework in computer science, such as Operating System(OS_LINUX layer), Kubernetes(k8s
|
||||
* layer). This kind of layer would be owners of different services/instances detected from different technology.
|
||||
*/
|
||||
public enum Layer {
|
||||
/**
|
||||
* Default Layer if the layer is not defined
|
||||
*/
|
||||
UNDEFINED(0),
|
||||
UNDEFINED(0, false),
|
||||
|
||||
/**
|
||||
* Envoy Access Log Service
|
||||
*/
|
||||
MESH(1),
|
||||
MESH(1, true),
|
||||
|
||||
/**
|
||||
* Agent-installed Service
|
||||
*/
|
||||
GENERAL(2),
|
||||
GENERAL(2, true),
|
||||
|
||||
/**
|
||||
* Operation System Linux
|
||||
*/
|
||||
OS_LINUX(3),
|
||||
OS_LINUX(3, true),
|
||||
|
||||
/**
|
||||
* Kubernetes, include pods, services, contains etc.
|
||||
*/
|
||||
K8S(4),
|
||||
K8S(4, true),
|
||||
|
||||
/**
|
||||
* Function as a Service
|
||||
*/
|
||||
FAAS(5),
|
||||
FAAS(5, true),
|
||||
|
||||
/**
|
||||
* Mesh control plane, eg. Istio control plane
|
||||
*/
|
||||
MESH_CP(6),
|
||||
MESH_CP(6, true),
|
||||
|
||||
/**
|
||||
* Mesh data plane, eg. Envoy
|
||||
*/
|
||||
MESH_DP(7),
|
||||
MESH_DP(7, true),
|
||||
|
||||
/**
|
||||
* Telemetry from real database
|
||||
*/
|
||||
DATABASE(8),
|
||||
DATABASE(8, true),
|
||||
|
||||
/**
|
||||
* Cache service eg. ehcache, guava-cache, memcache
|
||||
*/
|
||||
CACHE(9),
|
||||
CACHE(9, true),
|
||||
|
||||
/**
|
||||
* Telemetry from the Browser eg. Apache SkyWalking Client JS
|
||||
*/
|
||||
BROWSER(10),
|
||||
BROWSER(10, true),
|
||||
|
||||
/**
|
||||
* Self Observability of OAP
|
||||
*/
|
||||
SO11Y_OAP(11),
|
||||
SO11Y_OAP(11, true),
|
||||
|
||||
/**
|
||||
* Self Observability of Satellite
|
||||
*/
|
||||
SO11Y_SATELLITE(12),
|
||||
SO11Y_SATELLITE(12, true),
|
||||
|
||||
/**
|
||||
* Telemetry from the real MQ
|
||||
*/
|
||||
MQ(13),
|
||||
MQ(13, true),
|
||||
|
||||
/**
|
||||
* Database conjectured by client side plugin
|
||||
*/
|
||||
VIRTUAL_DATABASE(14),
|
||||
VIRTUAL_DATABASE(14, false),
|
||||
|
||||
/**
|
||||
* MQ conjectured by client side plugin
|
||||
*/
|
||||
VIRTUAL_MQ(15);
|
||||
VIRTUAL_MQ(15, false),
|
||||
|
||||
/**
|
||||
* The uninstrumented gateways configured in OAP
|
||||
*/
|
||||
VIRTUAL_GATEWAY(16, false);
|
||||
|
||||
private final int value;
|
||||
/**
|
||||
* The `normal` status represents this service is detected by an agent. The `un-normal` service is conjectured by
|
||||
* telemetry data collected from agents on/in the `normal` service.
|
||||
*/
|
||||
private final boolean isNormal;
|
||||
private static final Map<Integer, Layer> DICTIONARY = new HashMap<>();
|
||||
|
||||
static {
|
||||
Arrays.stream(Layer.values()).collect(Collectors.toMap(Layer::value, layer -> layer)).forEach(DICTIONARY::put);
|
||||
}
|
||||
|
||||
Layer(int value) {
|
||||
Layer(int value, boolean isNormal) {
|
||||
this.value = value;
|
||||
this.isNormal = isNormal;
|
||||
}
|
||||
|
||||
public int value() {
|
||||
|
|
@ -131,4 +142,8 @@ public enum Layer {
|
|||
}
|
||||
return layer;
|
||||
}
|
||||
|
||||
public boolean isNormal() {
|
||||
return isNormal;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,7 +29,6 @@ public class ServiceMetaDispatcher implements SourceDispatcher<ServiceMeta> {
|
|||
traffic.setTimeBucket(source.getTimeBucket());
|
||||
traffic.setName(source.getName());
|
||||
traffic.setLayer(source.getLayer());
|
||||
traffic.setNormal(source.isNormal());
|
||||
MetricsStreamProcessor.getInstance().in(traffic);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -85,13 +85,6 @@ public class ServiceTraffic extends Metrics {
|
|||
@Column(columnName = LAYER)
|
||||
private Layer layer = Layer.UNDEFINED;
|
||||
|
||||
/**
|
||||
* The `normal` status represents this service is detected by an agent. The `un-normal` service is conjectured by
|
||||
* telemetry data collected from agents on/in the `normal` service.
|
||||
*/
|
||||
@Setter
|
||||
private boolean isNormal = true;
|
||||
|
||||
/**
|
||||
* Primary key(id), to identify a service with different layers, a service could have more than one layer and be
|
||||
* saved as different records.
|
||||
|
|
@ -151,12 +144,10 @@ public class ServiceTraffic extends Metrics {
|
|||
public void entity2Storage(final ServiceTraffic storageData, final Convert2Storage converter) {
|
||||
final String serviceName = storageData.getName();
|
||||
storageData.setShortName(serviceName);
|
||||
if (storageData.isNormal) {
|
||||
int groupIdx = serviceName.indexOf(DOUBLE_COLONS_SPLIT);
|
||||
if (groupIdx > 0) {
|
||||
storageData.setGroup(serviceName.substring(0, groupIdx));
|
||||
storageData.setShortName(serviceName.substring(groupIdx + 2));
|
||||
}
|
||||
int groupIdx = serviceName.indexOf(DOUBLE_COLONS_SPLIT);
|
||||
if (groupIdx > 0) {
|
||||
storageData.setGroup(serviceName.substring(0, groupIdx));
|
||||
storageData.setShortName(serviceName.substring(groupIdx + 2));
|
||||
}
|
||||
converter.accept(NAME, serviceName);
|
||||
converter.accept(SHORT_NAME, storageData.getShortName());
|
||||
|
|
@ -190,7 +181,7 @@ public class ServiceTraffic extends Metrics {
|
|||
|
||||
public String getServiceId() {
|
||||
if (serviceId == null) {
|
||||
serviceId = IDManager.ServiceID.buildId(name, isNormal);
|
||||
serviceId = IDManager.ServiceID.buildId(name, layer.isNormal());
|
||||
}
|
||||
return serviceId;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,7 +29,6 @@ public class ServiceTrafficDispatcher implements SourceDispatcher<Service> {
|
|||
traffic.setTimeBucket(source.getTimeBucket());
|
||||
traffic.setName(source.getName());
|
||||
traffic.setLayer(source.getLayer());
|
||||
traffic.setNormal(source.isNormal());
|
||||
MetricsStreamProcessor.getInstance().in(traffic);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@ import java.util.Map;
|
|||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
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;
|
||||
|
||||
|
|
@ -59,8 +60,6 @@ public class Endpoint extends Source {
|
|||
@Setter
|
||||
@ScopeDefaultColumn.DefinedByField(columnName = "service_name", requireDynamicActive = true)
|
||||
private String serviceName;
|
||||
@Setter
|
||||
private boolean isServiceNormal;
|
||||
@Getter
|
||||
@Setter
|
||||
private String serviceInstanceName;
|
||||
|
|
@ -91,10 +90,13 @@ public class Endpoint extends Source {
|
|||
@Getter
|
||||
@Setter
|
||||
private SideCar sideCar = new SideCar();
|
||||
@Getter
|
||||
@Setter
|
||||
private Layer serviceLayer;
|
||||
|
||||
@Override
|
||||
public void prepare() {
|
||||
serviceId = IDManager.ServiceID.buildId(serviceName, isServiceNormal);
|
||||
serviceId = IDManager.ServiceID.buildId(serviceName, serviceLayer.isNormal());
|
||||
}
|
||||
|
||||
public String getTag(String key) {
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@ package org.apache.skywalking.oap.server.core.source;
|
|||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import org.apache.skywalking.oap.server.core.analysis.IDManager;
|
||||
import org.apache.skywalking.oap.server.core.analysis.Layer;
|
||||
|
||||
import static org.apache.skywalking.oap.server.core.source.DefaultScopeDefine.ENDPOINT_RELATION;
|
||||
import static org.apache.skywalking.oap.server.core.source.DefaultScopeDefine.ENDPOINT_RELATION_CATALOG_NAME;
|
||||
|
|
@ -51,8 +52,6 @@ public class EndpointRelation extends Source {
|
|||
@Setter
|
||||
@ScopeDefaultColumn.DefinedByField(columnName = "source_service_name", requireDynamicActive = true)
|
||||
private String serviceName;
|
||||
@Setter
|
||||
private boolean isServiceNormal;
|
||||
@Getter
|
||||
@Setter
|
||||
private String serviceInstanceName;
|
||||
|
|
@ -66,8 +65,6 @@ public class EndpointRelation extends Source {
|
|||
@Getter
|
||||
@ScopeDefaultColumn.DefinedByField(columnName = "child_service_name", requireDynamicActive = true)
|
||||
private String childServiceName;
|
||||
@Setter
|
||||
private boolean isChildServiceNormal;
|
||||
@Getter
|
||||
@Setter
|
||||
private String childServiceInstanceName;
|
||||
|
|
@ -96,11 +93,17 @@ public class EndpointRelation extends Source {
|
|||
@Getter
|
||||
@Setter
|
||||
private DetectPoint detectPoint;
|
||||
@Getter
|
||||
@Setter
|
||||
private Layer serviceLayer;
|
||||
@Getter
|
||||
@Setter
|
||||
private Layer childServiceLayer;
|
||||
|
||||
@Override
|
||||
public void prepare() {
|
||||
serviceId = IDManager.ServiceID.buildId(serviceName, isServiceNormal);
|
||||
childServiceId = IDManager.ServiceID.buildId(childServiceName, isChildServiceNormal);
|
||||
serviceId = IDManager.ServiceID.buildId(serviceName, serviceLayer.isNormal());
|
||||
childServiceId = IDManager.ServiceID.buildId(childServiceName, childServiceLayer.isNormal());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ public class Service extends Source {
|
|||
@Override
|
||||
public String getEntityId() {
|
||||
if (entityId == null) {
|
||||
entityId = IDManager.ServiceID.buildId(name, isNormal);
|
||||
entityId = IDManager.ServiceID.buildId(name, layer.isNormal());
|
||||
}
|
||||
return entityId;
|
||||
}
|
||||
|
|
@ -53,9 +53,6 @@ public class Service extends Source {
|
|||
@Setter
|
||||
@Getter
|
||||
private Layer layer;
|
||||
@Setter
|
||||
@Getter
|
||||
private boolean isNormal;
|
||||
@Getter
|
||||
@Setter
|
||||
private String serviceInstanceName;
|
||||
|
|
|
|||
|
|
@ -60,8 +60,6 @@ public class ServiceInstance extends Source {
|
|||
@Getter
|
||||
@Setter
|
||||
private Layer layer;
|
||||
@Setter
|
||||
private boolean isServiceNormal;
|
||||
@Getter
|
||||
@Setter
|
||||
private String endpointName;
|
||||
|
|
@ -99,7 +97,7 @@ public class ServiceInstance extends Source {
|
|||
|
||||
@Override
|
||||
public void prepare() {
|
||||
serviceId = IDManager.ServiceID.buildId(serviceName, isServiceNormal);
|
||||
serviceId = IDManager.ServiceID.buildId(serviceName, layer.isNormal());
|
||||
}
|
||||
|
||||
public String getTag(String key) {
|
||||
|
|
|
|||
|
|
@ -61,8 +61,6 @@ public class ServiceInstanceRelation extends Source {
|
|||
@Getter
|
||||
@Setter
|
||||
private Layer sourceServiceLayer;
|
||||
@Setter
|
||||
private boolean isSourceServiceNormal;
|
||||
@Getter
|
||||
@Setter
|
||||
@ScopeDefaultColumn.DefinedByField(columnName = "source_service_instance_name", requireDynamicActive = true)
|
||||
|
|
@ -74,8 +72,6 @@ public class ServiceInstanceRelation extends Source {
|
|||
@Getter
|
||||
@Setter
|
||||
private Layer destServiceLayer;
|
||||
@Setter
|
||||
private boolean isDestServiceNormal;
|
||||
@Getter
|
||||
@Setter
|
||||
@ScopeDefaultColumn.DefinedByField(columnName = "dest_service_name", requireDynamicActive = true)
|
||||
|
|
@ -124,8 +120,8 @@ public class ServiceInstanceRelation extends Source {
|
|||
|
||||
@Override
|
||||
public void prepare() {
|
||||
sourceServiceId = IDManager.ServiceID.buildId(sourceServiceName, isSourceServiceNormal);
|
||||
destServiceId = IDManager.ServiceID.buildId(destServiceName, isDestServiceNormal);
|
||||
sourceServiceId = IDManager.ServiceID.buildId(sourceServiceName, sourceServiceLayer.isNormal());
|
||||
destServiceId = IDManager.ServiceID.buildId(destServiceName, destServiceLayer.isNormal());
|
||||
sourceServiceInstanceId = IDManager.ServiceInstanceID.buildId(sourceServiceId, sourceServiceInstanceName);
|
||||
destServiceInstanceId = IDManager.ServiceInstanceID.buildId(destServiceId, destServiceInstanceName);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -37,10 +37,10 @@ public class ServiceMeta extends Source {
|
|||
|
||||
@Override
|
||||
public String getEntityId() {
|
||||
return IDManager.ServiceID.buildId(name, isNormal);
|
||||
return IDManager.ServiceID.buildId(name, layer.isNormal());
|
||||
}
|
||||
|
||||
private String name;
|
||||
private Layer layer;
|
||||
private boolean isNormal;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -56,8 +56,6 @@ public class ServiceRelation extends Source {
|
|||
@Setter
|
||||
@ScopeDefaultColumn.DefinedByField(columnName = "source_name", requireDynamicActive = true)
|
||||
private String sourceServiceName;
|
||||
@Setter
|
||||
private boolean isSourceNormal;
|
||||
@Getter
|
||||
@Setter
|
||||
private String sourceServiceInstanceName;
|
||||
|
|
@ -73,8 +71,6 @@ public class ServiceRelation extends Source {
|
|||
@Getter
|
||||
@Setter
|
||||
private Layer destLayer;
|
||||
@Setter
|
||||
private boolean isDestNormal;
|
||||
@Getter
|
||||
@Setter
|
||||
private String destServiceInstanceName;
|
||||
|
|
@ -118,7 +114,7 @@ public class ServiceRelation extends Source {
|
|||
|
||||
@Override
|
||||
public void prepare() {
|
||||
sourceServiceId = IDManager.ServiceID.buildId(sourceServiceName, isSourceNormal);
|
||||
destServiceId = IDManager.ServiceID.buildId(destServiceName, isDestNormal);
|
||||
sourceServiceId = IDManager.ServiceID.buildId(sourceServiceName, sourceLayer.isNormal());
|
||||
destServiceId = IDManager.ServiceID.buildId(destServiceName, destLayer.isNormal());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -117,7 +117,6 @@ public class ServiceManagementHandler extends AbstractKafkaHandler {
|
|||
|
||||
ServiceMeta serviceMeta = new ServiceMeta();
|
||||
serviceMeta.setName(serviceName);
|
||||
serviceMeta.setNormal(true);
|
||||
serviceMeta.setTimeBucket(timeBucket);
|
||||
serviceMeta.setLayer(Layer.GENERAL);
|
||||
sourceReceiver.receive(serviceMeta);
|
||||
|
|
|
|||
|
|
@ -120,7 +120,6 @@ public class EBPFProcessServiceHandler extends EBPFProcessServiceGrpc.EBPFProces
|
|||
// service
|
||||
final ServiceMeta serviceMeta = new ServiceMeta();
|
||||
serviceMeta.setName(serviceName);
|
||||
serviceMeta.setNormal(true);
|
||||
serviceMeta.setTimeBucket(timeBucket);
|
||||
serviceMeta.setLayer(layer);
|
||||
sourceReceiver.receive(serviceMeta);
|
||||
|
|
|
|||
|
|
@ -87,7 +87,6 @@ public final class ManagementServiceHandler {
|
|||
|
||||
ServiceMeta serviceMeta = new ServiceMeta();
|
||||
serviceMeta.setName(serviceName);
|
||||
serviceMeta.setNormal(true);
|
||||
serviceMeta.setTimeBucket(timeBucket);
|
||||
serviceMeta.setLayer(Layer.GENERAL);
|
||||
sourceReceiver.receive(serviceMeta);
|
||||
|
|
|
|||
|
|
@ -126,7 +126,6 @@ public class TelemetryDataDispatcher {
|
|||
service.setTimeBucket(minuteTimeBucket);
|
||||
service.setName(metrics.getDestServiceName());
|
||||
service.setLayer(Layer.MESH);
|
||||
service.setNormal(true);
|
||||
service.setServiceInstanceName(metrics.getDestServiceInstance());
|
||||
service.setEndpointName(metrics.getEndpoint());
|
||||
service.setLatency(metrics.getLatency());
|
||||
|
|
@ -146,11 +145,9 @@ public class TelemetryDataDispatcher {
|
|||
serviceRelation.setTimeBucket(minuteTimeBucket);
|
||||
serviceRelation.setSourceServiceName(metrics.getSourceServiceName());
|
||||
serviceRelation.setSourceLayer(Layer.MESH);
|
||||
serviceRelation.setSourceNormal(true);
|
||||
serviceRelation.setSourceServiceInstanceName(metrics.getSourceServiceInstance());
|
||||
serviceRelation.setDestServiceName(metrics.getDestServiceName());
|
||||
serviceRelation.setDestLayer(Layer.MESH);
|
||||
serviceRelation.setDestNormal(true);
|
||||
serviceRelation.setDestServiceInstanceName(metrics.getDestServiceInstance());
|
||||
serviceRelation.setEndpoint(metrics.getEndpoint());
|
||||
serviceRelation.setLatency(metrics.getLatency());
|
||||
|
|
@ -174,7 +171,6 @@ public class TelemetryDataDispatcher {
|
|||
serviceInstance.setName(metrics.getDestServiceInstance());
|
||||
serviceInstance.setServiceName(metrics.getDestServiceName());
|
||||
serviceInstance.setLayer(Layer.MESH);
|
||||
serviceInstance.setServiceNormal(true);
|
||||
serviceInstance.setEndpointName(metrics.getEndpoint());
|
||||
serviceInstance.setLatency(metrics.getLatency());
|
||||
serviceInstance.setStatus(metrics.getStatus());
|
||||
|
|
@ -194,10 +190,8 @@ public class TelemetryDataDispatcher {
|
|||
serviceRelation.setSourceServiceInstanceName(metrics.getSourceServiceInstance());
|
||||
serviceRelation.setSourceServiceName(metrics.getSourceServiceName());
|
||||
serviceRelation.setSourceServiceLayer(Layer.MESH);
|
||||
serviceRelation.setSourceServiceNormal(true);
|
||||
serviceRelation.setDestServiceInstanceName(metrics.getDestServiceInstance());
|
||||
serviceRelation.setDestServiceLayer(Layer.MESH);
|
||||
serviceRelation.setDestServiceNormal(true);
|
||||
serviceRelation.setDestServiceName(metrics.getDestServiceName());
|
||||
serviceRelation.setEndpoint(metrics.getEndpoint());
|
||||
serviceRelation.setLatency(metrics.getLatency());
|
||||
|
|
@ -223,7 +217,7 @@ public class TelemetryDataDispatcher {
|
|||
endpoint.setTimeBucket(minuteTimeBucket);
|
||||
endpoint.setName(metrics.getEndpoint());
|
||||
endpoint.setServiceName(metrics.getDestServiceName());
|
||||
endpoint.setServiceNormal(true);
|
||||
endpoint.setServiceLayer(Layer.MESH);
|
||||
endpoint.setServiceInstanceName(metrics.getDestServiceInstance());
|
||||
endpoint.setLatency(metrics.getLatency());
|
||||
endpoint.setStatus(metrics.getStatus());
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
Subproject commit f1e405fbb4fccef12b8157585da290c8818d7f03
|
||||
Subproject commit 049f46a4cfe6ac68ae4d2fabd8257938f1cd3493
|
||||
Loading…
Reference in New Issue