diff --git a/skywalking-api/src/main/java/com/ai/cloud/skywalking/util/TraceIdGenerator.java b/skywalking-api/src/main/java/com/ai/cloud/skywalking/util/TraceIdGenerator.java index 61ea2fe51..1fc259806 100644 --- a/skywalking-api/src/main/java/com/ai/cloud/skywalking/util/TraceIdGenerator.java +++ b/skywalking-api/src/main/java/com/ai/cloud/skywalking/util/TraceIdGenerator.java @@ -3,11 +3,30 @@ package com.ai.cloud.skywalking.util; import java.util.UUID; public final class TraceIdGenerator { + private static final ThreadLocal ThreadTraceIdSequence = new ThreadLocal(); + + private static final String PROCESS_UUID; + + static{ + String uuid = UUID.randomUUID().toString().replaceAll("-", ""); + PROCESS_UUID = uuid.substring(uuid.length() - 7); + } + private TraceIdGenerator() { - // Non } - - public static String generate() { - return UUID.randomUUID().toString().replaceAll("-", ""); + + public static String generate(){ + Integer seq = ThreadTraceIdSequence.get(); + if(seq == null || seq == 10000 || seq > 10000){ + seq = 0; + } + seq++; + ThreadTraceIdSequence.set(seq); + + return System.currentTimeMillis() + + "." + PROCESS_UUID + + "." + BuriedPointMachineUtil.getProcessNo() + + "." + Thread.currentThread().getId() + + "." + seq; } } diff --git a/skywalking-webui/src/main/java/com/ai/cloud/util/view/BaseFreeMarkerView.java b/skywalking-webui/src/main/java/com/ai/cloud/util/view/BaseFreeMarkerView.java index 68c5e136d..714dad4ef 100644 --- a/skywalking-webui/src/main/java/com/ai/cloud/util/view/BaseFreeMarkerView.java +++ b/skywalking-webui/src/main/java/com/ai/cloud/util/view/BaseFreeMarkerView.java @@ -41,7 +41,7 @@ public class BaseFreeMarkerView extends FreeMarkerView { } String uid = (String) session.getAttribute("uid"); if(StringUtil.isBlank(uid)){ - uid = "0"; + uid = "-1"; } String userName = (String) session.getAttribute("userName"); if(StringUtil.isBlank(userName)){ diff --git a/skywalking-webui/src/main/webapp/ftl/lib/ai.cloud/common.ftl b/skywalking-webui/src/main/webapp/ftl/lib/ai.cloud/common.ftl index c33ff42c9..14241ba48 100644 --- a/skywalking-webui/src/main/webapp/ftl/lib/ai.cloud/common.ftl +++ b/skywalking-webui/src/main/webapp/ftl/lib/ai.cloud/common.ftl @@ -111,7 +111,7 @@ ${logInfo.spanTypeName!'UNKNOWN'} ${logInfo.statusCodeName!'MISSING'} - ${logInfo.viewPointIdSub!} ${logInfo.address!} @@ -250,6 +250,8 @@
    +
  • + 服务/方法:${logInfo.viewPointId!''}
  • 调用类型:${logInfo.spanTypeName!'UNKNOWN'}
  • @@ -280,4 +282,25 @@
- \ No newline at end of file + + +<#macro detailTraceLog> + + + diff --git a/skywalking-webui/src/main/webapp/ftl/traceLog.ftl b/skywalking-webui/src/main/webapp/ftl/traceLog.ftl index ed7bc3eca..84153a869 100644 --- a/skywalking-webui/src/main/webapp/ftl/traceLog.ftl +++ b/skywalking-webui/src/main/webapp/ftl/traceLog.ftl @@ -12,10 +12,13 @@ + + <@common.detailTraceLog /> + <@common.dealTraceLog /> - + <@common.importOriginLog /> @@ -54,6 +57,13 @@ } }); + $("a[name='detailInfo']").each(function(index,ele){ + $(this).bind("click",function(){ + $("#detailContent").html($("#collapse"+index).html()); + $("#detailLog").modal('show'); + }); + }); + $('#example-advanced').treetable('expandAll'); }); diff --git a/skywalking-webui/src/main/webapp/js/webui-0.1.js b/skywalking-webui/src/main/webapp/js/webui-0.1.js index fee057468..e6f3b138f 100644 --- a/skywalking-webui/src/main/webapp/js/webui-0.1.js +++ b/skywalking-webui/src/main/webapp/js/webui-0.1.js @@ -22,7 +22,7 @@ $().ready(function() { changeFrameUrl(baseUrl + "/showTraceLog/" + srchKey); } } else { - if(uid>0){ + if(uid>=0){ changeFrameUrl(baseUrl + "/applist"); } $("#srchKey").val("");