未验证 提交 fed62aa7 编写于 作者: wu-sheng's avatar wu-sheng 提交者: GitHub

Fix #4813 (#4815)

上级 a12ecea4
......@@ -86,28 +86,28 @@ public class NamingControl implements Service {
}
/**
* Format endpoint name by using the length config in the core module. This is a global rule, every place including
* endpoint as the {@link org.apache.skywalking.oap.server.core.source.Source} should follow this for any core
* module implementation.
* Format endpoint name by using the length config in the core module. This is a global rule, every {@link
* org.apache.skywalking.oap.server.core.source.Source} including endpoint should follow this for any core module
* implementation.
*
* @param serviceName the service of the given endpoint.
* @param endpointName raw data, literal string.
* @return the string, which length less than or equals {@link #endpointNameMaxLength};
*/
public String formatEndpointName(String serviceName, String endpointName) {
String lengthControlledName = endpointName;
if (endpointName.length() > endpointNameMaxLength) {
final String rename = endpointName.substring(0, endpointNameMaxLength);
lengthControlledName = endpointName.substring(0, endpointNameMaxLength);
if (log.isDebugEnabled()) {
log.debug(
"Endpoint {} has been renamed to {} due to length limitation {}",
endpointName,
rename,
lengthControlledName,
serviceNameMaxLength
);
}
return endpointNameGrouping.format(serviceName, rename);
} else {
return endpointName;
}
return endpointNameGrouping.format(serviceName, lengthControlledName);
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册