use of com.nr.instrumentation.jersey.client.OutboundWrapper in project newrelic-java-agent by newrelic.
the class ClientHandler_Instrumentation method handle.
@Trace(leaf = true)
public ClientResponse handle(ClientRequest request) throws ClientHandlerException {
NewRelic.getAgent().getTracedMethod().addOutboundRequestHeaders(new OutboundWrapper(request));
ClientResponse response = Weaver.callOriginal();
NewRelic.getAgent().getTracedMethod().reportAsExternal(HttpParameters.library(JerseyClientUtils.JERSEY_CLIENT).uri(request.getURI()).procedure(request.getMethod()).inboundHeaders(new InboundWrapper(response)).build());
return response;
}
use of com.nr.instrumentation.jersey.client.OutboundWrapper in project newrelic-java-agent by newrelic.
the class ClientRuntime_Instrumentation method createRunnableForAsyncProcessing.
Runnable createRunnableForAsyncProcessing(ClientRequest request, final ResponseCallback_Instrumentation callback) {
Transaction transaction = AgentBridge.getAgent().getTransaction(false);
if (transaction != null) {
callback.segment = transaction.startSegment(JerseyClientUtils.JERSEY_SEGMENT_NAME);
callback.segment.addOutboundRequestHeaders(new OutboundWrapper(request));
}
return Weaver.callOriginal();
}
use of com.nr.instrumentation.jersey.client.OutboundWrapper in project newrelic-java-agent by newrelic.
the class ClientRuntime_Instrumentation method invoke.
@Trace(leaf = true)
public ClientResponse invoke(final ClientRequest request) throws Exception {
NewRelic.getAgent().getTracedMethod().addOutboundRequestHeaders(new OutboundWrapper(request));
ClientResponse response;
try {
response = Weaver.callOriginal();
} catch (ProcessingException ex) {
if (ex.getCause() instanceof UnknownHostException) {
NewRelic.getAgent().getTracedMethod().reportAsExternal(HttpParameters.library(JerseyClientUtils.JERSEY_CLIENT).uri(JerseyClientUtils.UNKNOWN_HOST_URI).procedure(JerseyClientUtils.FAILED).noInboundHeaders().build());
}
throw ex;
}
NewRelic.getAgent().getTracedMethod().reportAsExternal(HttpParameters.library(JerseyClientUtils.JERSEY_CLIENT).uri(request.getUri()).procedure(request.getMethod()).inboundHeaders(new InboundWrapper(response)).build());
return response;
}
use of com.nr.instrumentation.jersey.client.OutboundWrapper in project newrelic-java-agent by newrelic.
the class ClientRuntime_Instrumentation method submit.
public void submit(final ClientRequest request, ResponseCallback_Instrumentation callback) {
Transaction transaction = AgentBridge.getAgent().getTransaction(false);
if (transaction != null) {
callback.segment = transaction.startSegment(JerseyClientUtils.JERSEY_SEGMENT_NAME);
callback.segment.addOutboundRequestHeaders(new OutboundWrapper(request));
}
Weaver.callOriginal();
}
Aggregations