Get the MQ server address id from reference. (#891)
This commit is contained in:
parent
f17f69b377
commit
6e8925084e
|
|
@ -80,9 +80,8 @@ public class ServiceReferenceMetricSpanListener implements FirstSpanListener, En
|
|||
serviceReferenceMetric.setFrontServiceId(reference.getParentServiceId());
|
||||
|
||||
if (spanDecorator.getSpanLayer().equals(SpanLayer.MQ)) {
|
||||
int peerId = spanDecorator.getPeerId();
|
||||
int applicationIdByPeerId = applicationCacheService.getApplicationIdByAddressId(peerId);
|
||||
int instanceIdByPeerId = instanceCacheService.getInstanceIdByAddressId(applicationIdByPeerId, peerId);
|
||||
int applicationIdByPeerId = applicationCacheService.getApplicationIdByAddressId(reference.getNetworkAddressId());
|
||||
int instanceIdByPeerId = instanceCacheService.getInstanceIdByAddressId(applicationIdByPeerId, reference.getNetworkAddressId());
|
||||
serviceReferenceMetric.setFrontInstanceId(instanceIdByPeerId);
|
||||
serviceReferenceMetric.setFrontApplicationId(applicationIdByPeerId);
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ public class SegmentBase64Printer {
|
|||
private static final Logger LOGGER = LoggerFactory.getLogger(SegmentBase64Printer.class);
|
||||
|
||||
public static void main(String[] args) throws InvalidProtocolBufferException {
|
||||
String segmentBase64 = "CgwKCgIBsv/x1L2vgBsSggEQ////////////ARirnsP1niwg9Z7D9Z4sOhhIMi9KREJJL0Nvbm5lY3Rpb24vY2xvc2VKDGxvY2FsaG9zdDotMVABWAFgBHoOCgdkYi50eXBlEgNzcWx6GQoLZGIuaW5zdGFuY2USCmRhdGFTb3VyY2V6DgoMZGIuc3RhdGVtZW50GP///////////wEgAg==";
|
||||
String segmentBase64 = "CgwKCgMXjPKUga3WgBsSvAEIARiF7Jq1nywgp+yatZ8sKlASDAoKAnPAqKD5rNaAGxgBIAIqDjEyNy4wLjAuMTo5MDkyOAJCFC9zZW5kTWVzc2FnZS97Y291bnR9UhQvc2VuZE1lc3NhZ2Uve2NvdW50fTocS2Fma2EvVHJhY2UtdG9waWMtMS9Db25zdW1lclgEYBt6GwoJbXEuYnJva2VyEg4xMjcuMC4wLjE6OTA5MnoZCghtcS50b3BpYxINVHJhY2UtdG9waWMtMRImEP///////////wEY/+uatZ8sILTsmrWfLDD///////////8BUAIYAiAD";
|
||||
byte[] binarySegment = Base64.getDecoder().decode(segmentBase64);
|
||||
TraceSegmentObject segmentObject = TraceSegmentObject.parseFrom(binarySegment);
|
||||
|
||||
|
|
@ -72,6 +72,15 @@ public class SegmentBase64Printer {
|
|||
LOGGER.info(" reference:");
|
||||
span.getRefsList().forEach(reference -> {
|
||||
LOGGER.info(" EntryApplicationInstanceId: {}", reference.getEntryApplicationInstanceId());
|
||||
LOGGER.info(" EntryServiceId: {}", reference.getEntryServiceId());
|
||||
LOGGER.info(" EntryServiceName: {}", reference.getEntryServiceName());
|
||||
LOGGER.info(" ParentTraceSegmentId: {}", reference.getParentTraceSegmentId());
|
||||
LOGGER.info(" ParentSpanId: {}", reference.getParentSpanId());
|
||||
LOGGER.info(" ParentApplicationInstanceId: {}", reference.getParentApplicationInstanceId());
|
||||
LOGGER.info(" ParentServiceId: {}", reference.getParentServiceId());
|
||||
LOGGER.info(" ParentServiceName: {}", reference.getParentServiceName());
|
||||
LOGGER.info(" NetworkAddressId: {}", reference.getNetworkAddressId());
|
||||
LOGGER.info(" NetworkAddress: {}", reference.getNetworkAddress());
|
||||
});
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue