private void setRemoteForException(Subsegment subsegment, Throwable exception) { subsegment.getCause().getExceptions().forEach((e) -> { if (e.getThrowable() == exception) { e.setRemote(true); } }); }
private ThrowableDescription describeThrowable(Throwable throwable, String id) { ThrowableDescription description = new ThrowableDescription(); description.setId(id); description.setMessage(throwable.getMessage()); description.setType(throwable.getClass().getName()); StackTraceElement[] stackTrace = throwable.getStackTrace(); if (stackTrace.length > maxStackTraceLength) { description.setStack(Arrays.copyOfRange(stackTrace, 0, maxStackTraceLength)); description.setTruncated(stackTrace.length - maxStackTraceLength); } else { description.setStack(stackTrace); } description.setThrowable(throwable); if (isRemote(throwable)) { description.setRemote(true); } return description; }
@Override public void serialize(Cause cause, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException { if (!cause.getExceptions().isEmpty()) { ThrowableDescription first = cause.getExceptions().get(0); if (null == first.getId() && null != first.getCause()) { jsonGenerator.writeString(first.getCause()); return; } } objectSerializer.serialize(cause, jsonGenerator, serializerProvider); }
ThrowableDescription description = new ThrowableDescription(); description.setCause( null == exceptionReferenced.get().getId() ? exceptionReferenced.get().getCause() : exceptionReferenced.get().getId() ); description.setThrowable(throwable); result.add(description); return result; description.setCause( null == exceptionReferenced.get().getId() ? exceptionReferenced.get().getCause() : exceptionReferenced.get().getId() ); } else { description.setCause(newId);
private Optional<ThrowableDescription> referenceInChildren(Throwable throwable, List<Subsegment> subsegments) { return subsegments.parallelStream() .flatMap(subsegment -> subsegment.getCause().getExceptions().stream()) .filter(throwableDescription -> throwable.equals(throwableDescription.getThrowable())) .findAny(); }
ThrowableDescription description = new ThrowableDescription(); description.setCause( null == exceptionReferenced.get().getId() ? exceptionReferenced.get().getCause() : exceptionReferenced.get().getId() ); description.setThrowable(throwable); result.add(description); return result; description.setCause( null == exceptionReferenced.get().getId() ? exceptionReferenced.get().getCause() : exceptionReferenced.get().getId() ); } else { description.setCause(newId);
private Optional<ThrowableDescription> referenceInChildren(Throwable throwable, List<Subsegment> subsegments) { return subsegments.parallelStream() .flatMap(subsegment -> subsegment.getCause().getExceptions().stream()) .filter(throwableDescription -> throwable.equals(throwableDescription.getThrowable())) .findAny(); }
private ThrowableDescription describeThrowable(Throwable throwable, String id) { ThrowableDescription description = new ThrowableDescription(); description.setId(id); description.setMessage(throwable.getMessage()); description.setType(throwable.getClass().getName()); StackTraceElement[] stackTrace = throwable.getStackTrace(); if (stackTrace.length > maxStackTraceLength) { description.setStack(Arrays.copyOfRange(stackTrace, 0, maxStackTraceLength)); description.setTruncated(stackTrace.length - maxStackTraceLength); } else { description.setStack(stackTrace); } description.setThrowable(throwable); if (isRemote(throwable)) { description.setRemote(true); } return description; }
private void setRemoteForException(Subsegment subsegment, Throwable exception) { subsegment.getCause().getExceptions().forEach((e) -> { if (e.getThrowable() == exception) { e.setRemote(true); } }); }
@Override public void serialize(Cause cause, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException { if (!cause.getExceptions().isEmpty()) { ThrowableDescription first = cause.getExceptions().get(0); if (null == first.getId() && null != first.getCause()) { jsonGenerator.writeString(first.getCause()); return; } } objectSerializer.serialize(cause, jsonGenerator, serializerProvider); }