kezhenxu94 commented on a change in pull request #3105: Provide a configuration
to control the length of the peer field
URL: https://github.com/apache/skywalking/pull/3105#discussion_r305564856
##########
File path:
apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/context/util/PeerFormat.java
##########
@@ -25,13 +25,11 @@
* @author zhaoyuguang
*/
-public enum PeerFormat {
-
- INSTANCE;
+public class PeerFormat {
private static final String ABBR = "...";
- public String Shorten(String original) {
+ public static String shorten(String original) {
if (!StringUtil.isEmpty(original) && original.length() >
Config.Plugin.PEER_MAX_LENGTH) {
return original.substring(0, Config.Plugin.PEER_MAX_LENGTH - 3) +
ABBR;
Review comment:
What if users set `Config.Plugin.PEER_MAX_LENGTH` to less than `3`
(intentionally or by mistake) 😄
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services