leon756 commented on code in PR #10990:
URL: https://github.com/apache/skywalking/pull/10990#discussion_r1241064143
##########
oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/metrics/Event.java:
##########
@@ -153,8 +154,15 @@ public boolean combine(final Metrics metrics) {
* @since 9.0.0 Limit the length of {@link #parameters}
*/
public void setParameters(String parameters) {
- this.parameters = parameters == null || parameters.length() <=
PARAMETER_MAX_LENGTH ?
- parameters : parameters.substring(0, PARAMETER_MAX_LENGTH);
+ if (parameters == null || parameters.length() <= PARAMETER_MAX_LENGTH)
{
+ this.parameters = parameters;
+ } else {
+ try {
+ this.parameters = StringUtil.trimJson(parameters,
PARAMETER_MAX_LENGTH);
+ } catch (Exception e) {
Review Comment:
If not, `JsonParser.parseString(jsonString)` may throw `JsonSyntaxException`
--
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]