Skip to content

Commit

Permalink
[#9631] Limit length of stackTrace strings for better stability
Browse files Browse the repository at this point in the history
  • Loading branch information
intr3p1d committed Oct 16, 2023
1 parent 30fec4e commit 035fa6b
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
package com.navercorp.pinpoint.exceptiontrace.web.mapper;

import com.navercorp.pinpoint.common.server.mapper.MapStructUtils;
import com.navercorp.pinpoint.common.util.StringUtils;
import com.navercorp.pinpoint.exceptiontrace.common.model.StackTraceElementWrapper;
import com.navercorp.pinpoint.exceptiontrace.web.entity.ExceptionMetaDataEntity;
import org.mapstruct.Qualifier;
Expand Down Expand Up @@ -58,14 +59,17 @@ public List<StackTraceElementWrapper> stackTrace(ExceptionMetaDataEntity entity)
for (int i = 0; i < classNameIterable.size(); i++) {
wrappers.add(
new StackTraceElementWrapper(
classNameIterable.get(i),
fileNameIterable.get(i),
abbreviate(classNameIterable.get(i)),
abbreviate(fileNameIterable.get(i)),
lineNumberIterable.get(i),
methodNameIterable.get(i)
abbreviate(methodNameIterable.get(i))
)
);
}
return wrappers;
}

private static String abbreviate(String str) {
return StringUtils.abbreviate(str, 2048);
}
}

0 comments on commit 035fa6b

Please sign in to comment.