use of com.amazonaws.xray.entities.Subsegment in project aws-xray-sdk-java by aws.
the class AbstractXRayInterceptor method processXRayTrace.
protected Object processXRayTrace(ProceedingJoinPoint pjp) throws Throwable {
try {
Subsegment subsegment = AWSXRay.beginSubsegment(pjp.getSignature().getName());
subsegment.setMetadata(generateMetadata(pjp, subsegment));
return XRayInterceptorUtils.conditionalProceed(pjp);
} catch (Exception e) {
AWSXRay.getCurrentSegment().addException(e);
throw e;
} finally {
logger.trace("Ending Subsegment");
AWSXRay.endSubsegment();
}
}
use of com.amazonaws.xray.entities.Subsegment in project aws-xray-sdk-java by aws.
the class TracedHttpClient method execute.
@Override
public <T> T execute(final HttpUriRequest request, final ResponseHandler<? extends T> responseHandler) throws IOException, ClientProtocolException {
Subsegment subsegment = recorder.beginSubsegment(determineTarget(request).getHostName());
return wrapHttpSupplier(subsegment, () -> {
if (null != subsegment) {
TracedHttpClient.addRequestInformation(subsegment, request, TracedHttpClient.getUrl(request));
}
TracedResponseHandler<? extends T> wrappedHandler = new TracedResponseHandler<>(responseHandler);
T response = wrappedClient.execute(request, wrappedHandler);
return response;
});
}
use of com.amazonaws.xray.entities.Subsegment in project aws-xray-sdk-java by aws.
the class TracedHttpClient method execute.
@Override
public <T> T execute(final HttpHost target, final HttpRequest request, final ResponseHandler<? extends T> responseHandler, final HttpContext context) throws IOException, ClientProtocolException {
Subsegment subsegment = recorder.beginSubsegment(target.getHostName());
return wrapHttpSupplier(subsegment, () -> {
if (null != subsegment) {
TracedHttpClient.addRequestInformation(subsegment, request, TracedHttpClient.getUrl(target, request));
}
TracedResponseHandler<? extends T> wrappedHandler = new TracedResponseHandler<>(responseHandler);
T response = wrappedClient.execute(target, request, wrappedHandler, context);
return response;
});
}
use of com.amazonaws.xray.entities.Subsegment in project aws-xray-sdk-java by aws.
the class TracedHttpClient method execute.
@Override
public <T> T execute(final HttpUriRequest request, final ResponseHandler<? extends T> responseHandler, final HttpContext context) throws IOException, ClientProtocolException {
Subsegment subsegment = recorder.beginSubsegment(determineTarget(request).getHostName());
return wrapHttpSupplier(subsegment, () -> {
if (null != subsegment) {
TracedHttpClient.addRequestInformation(subsegment, request, TracedHttpClient.getUrl(request));
}
TracedResponseHandler<? extends T> wrappedHandler = new TracedResponseHandler<>(responseHandler);
T response = wrappedClient.execute(request, wrappedHandler, context);
return response;
});
}
use of com.amazonaws.xray.entities.Subsegment in project aws-xray-sdk-java by aws.
the class TracedHttpClient method execute.
@Override
public <T> T execute(final HttpHost target, final HttpRequest request, final ResponseHandler<? extends T> responseHandler) throws IOException, ClientProtocolException {
Subsegment subsegment = recorder.beginSubsegment(target.getHostName());
return wrapHttpSupplier(subsegment, () -> {
if (null != subsegment) {
TracedHttpClient.addRequestInformation(subsegment, request, TracedHttpClient.getUrl(target, request));
}
TracedResponseHandler<? extends T> wrappedHandler = new TracedResponseHandler<>(responseHandler);
T response = wrappedClient.execute(target, request, wrappedHandler);
return response;
});
}
Aggregations