wu-sheng commented on code in PR #10990:
URL: https://github.com/apache/skywalking/pull/10990#discussion_r1241063210


##########
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:
   I can't see the point of this catch. What do you want to do about this case? 
When is the exception thrown?



-- 
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]

Reply via email to