use of com.newrelic.agent.bridge.Transaction in project newrelic-java-agent by newrelic.
the class ContainerResponse method close.
public void close() {
Transaction tx = AgentBridge.getAgent().getTransaction(false);
if (tx != null) {
tx.getCrossProcessState().processOutboundResponseHeaders(new ResponseImpl(this), contentLength);
}
// Optimization. This allows the weaver to clear the backing NewField map
contentLength = 0;
Weaver.callOriginal();
}
use of com.newrelic.agent.bridge.Transaction 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.newrelic.agent.bridge.Transaction 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();
}
use of com.newrelic.agent.bridge.Transaction in project newrelic-java-agent by newrelic.
the class HttpRequestToMuleEvent_Instrumentation method transform.
/**
* Verify the method body produces the same URI information as in module-3.6.
*/
@Trace
public static MuleEvent transform(final HttpRequestContext requestContext, final MuleContext muleContext, final FlowConstruct flowConstruct, Boolean parseRequest, ListenerPath listenerPath) {
MuleEvent event = Weaver.callOriginal();
final MuleHttpConnectorRequest muleRequest = new MuleHttpConnectorRequest(event, requestContext);
URI uri = resolveUriForNR(requestContext);
NewRelic.getAgent().getTracedMethod().reportAsExternal(HttpParameters.library("MuleHTTP").uri(uri).procedure("writeResponse").inboundHeaders(muleRequest).build());
final Transaction txn = AgentBridge.getAgent().getTransaction(false);
txn.setWebRequest(muleRequest);
final String txnName = event.getMessage().getInboundProperty("http.listener.path") + " (" + muleRequest.getMethod() + ")";
txn.setTransactionName(TransactionNamePriority.FRAMEWORK_HIGH, true, "Mule/Connector", txnName);
return event;
}
use of com.newrelic.agent.bridge.Transaction in project newrelic-java-agent by newrelic.
the class NettyDispatcher method channelRead.
@Trace(dispatcher = true)
public static void channelRead(ChannelHandlerContext_Instrumentation ctx, Object msg) {
ctx.pipeline().token = AgentBridge.getAgent().getTransaction().getToken();
TracedMethod tracer = AgentBridge.getAgent().getTransaction().getTracedMethod();
if (tracer == null) {
// it happens.
AgentBridge.getAgent().getLogger().log(Level.FINEST, "Unable to dispatch netty tx. No tracer.");
} else {
tracer.setMetricName("NettyUpstreamDispatcher");
AgentBridge.getAgent().getTransaction().setTransactionName(TransactionNamePriority.SERVLET_NAME, true, "NettyDispatcher", "NettyDispatcher");
}
Transaction tx = AgentBridge.getAgent().getTransaction(false);
if (tx != null) {
tx.setWebRequest(new RequestWrapper((HttpRequest) msg));
}
}
Aggregations