1. 修改配置名字
This commit is contained in:
parent
e032ef282f
commit
010719e976
|
|
@ -28,7 +28,7 @@ public class Config {
|
|||
public static int BUFFER_MAX_SIZE = 18000;
|
||||
|
||||
// Buffer池的最大长度
|
||||
public static int POOL_MAX_LENGTH = 5;
|
||||
public static int POOL_SIZE = 5;
|
||||
}
|
||||
|
||||
public static class Sender {
|
||||
|
|
@ -59,4 +59,8 @@ public class Config {
|
|||
}
|
||||
|
||||
|
||||
public static class BusinessKey {
|
||||
//Business Key 最大长度
|
||||
public static int MAX_LENGTH = 300;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,11 +1,13 @@
|
|||
package com.ai.cloud.skywalking.util;
|
||||
|
||||
import com.ai.cloud.skywalking.conf.AuthDesc;
|
||||
import com.ai.cloud.skywalking.conf.Config;
|
||||
import com.ai.cloud.skywalking.context.Context;
|
||||
import com.ai.cloud.skywalking.context.Span;
|
||||
|
||||
public final class BusinessKeyTracing {
|
||||
|
||||
private static final char spiltChar='^';
|
||||
private static final char spiltChar = '^';
|
||||
|
||||
|
||||
private BusinessKeyTracing() {
|
||||
|
|
@ -13,8 +15,14 @@ public final class BusinessKeyTracing {
|
|||
}
|
||||
|
||||
public static void trace(String businessKey) {
|
||||
//
|
||||
|
||||
if (!AuthDesc.isAuth())
|
||||
return;
|
||||
|
||||
Span spanData = Context.getLastSpan();
|
||||
spanData.setBusinessKey(businessKey.replace('-',spiltChar));
|
||||
if (spanData != null) {
|
||||
return;
|
||||
}
|
||||
spanData.setBusinessKey(businessKey.replace('-', spiltChar).substring(0, Config.BusinessKey.MAX_LENGTH));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue