life- commented on code in PR #609:
URL: https://github.com/apache/skywalking-java/pull/609#discussion_r1325405439
##########
apm-commons/apm-util/src/main/java/org/apache/skywalking/apm/util/ConfigInitializer.java:
##########
@@ -85,9 +85,16 @@ private static void initNextLevel(Properties properties,
Class<?> recentConfigTy
} else {
// Convert the value into real type
final Length lengthDefine =
field.getAnnotation(Length.class);
- if (lengthDefine != null && propertyValue.length() >
lengthDefine.value()) {
- StringUtil.cut(propertyValue,
lengthDefine.value());
- System.err.printf("The config value will be
truncated , because the length max than %d : %s -> %s%n", lengthDefine.value(),
configKey, propertyValue);
+ if (lengthDefine != null) {
+ int lengthLimited = lengthDefine.value();
+ String lengthKey = String.format("%s#length",
configKey);
+ if (properties.containsKey(lengthKey)) {
+ lengthLimited = Math.max(lengthLimited,
Integer.valueOf(properties.getProperty(lengthKey, "0")));
+ }
Review Comment:
The default value is 50, which means it is the suggested value. If the
configuration is smaller than it which means most of the service names or
instance names will be cut especially in k8s environment.
So we suggest the configuration for the length is better bigger than the
default value.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]