use of com.nr.agent.instrumentation.rabbitamqp500.InboundWrapper in project newrelic-java-agent by newrelic.
the class Consumer_Instrumentation method handleDelivery.
@Trace(dispatcher = true)
public void handleDelivery(String consumerTag, Envelope envelope, AMQP.BasicProperties properties, byte[] body) throws IOException {
RabbitAMQPMetricUtil.nameTransaction(envelope.getExchange());
AgentBridge.getAgent().getTransaction().provideHeaders(new InboundWrapper(properties.getHeaders()));
AgentBridge.getAgent().getTransaction(false).setTransportType(TransportType.AMQP);
RabbitAMQPMetricUtil.addConsumeAttributes(null, envelope.getRoutingKey(), properties);
Weaver.callOriginal();
}
use of com.nr.agent.instrumentation.rabbitamqp500.InboundWrapper in project newrelic-java-agent by newrelic.
the class HttpAsyncResponseConsumer_Instrumentation method responseReceived.
/**
* Invoked when a HTTP response message is received.
*/
public void responseReceived(HttpResponse response) throws IOException, HttpException {
inboundHeaders = new InboundWrapper(response);
httpResponse = response;
Weaver.callOriginal();
}
use of com.nr.agent.instrumentation.rabbitamqp500.InboundWrapper in project newrelic-java-agent by newrelic.
the class HttpClient method processResponse.
private static void processResponse(URI requestURI, HttpResponse response) {
InboundWrapper inboundCatWrapper = new InboundWrapper(response);
NewRelic.getAgent().getTracedMethod().reportAsExternal(HttpParameters.library(LIBRARY).uri(requestURI).procedure(PROCEDURE).inboundHeaders(inboundCatWrapper).status(response.getStatusLine().getStatusCode(), response.getStatusLine().getReasonPhrase()).build());
}
use of com.nr.agent.instrumentation.rabbitamqp500.InboundWrapper in project newrelic-java-agent by newrelic.
the class HttpMethodBase method execute.
@Trace(leaf = true)
public int execute(HttpState state, HttpConnection conn) throws IOException {
String host = null;
String uri = null;
TracedMethod method = AgentBridge.getAgent().getTracedMethod();
Transaction tx = AgentBridge.getAgent().getTransaction();
if (!checkForIgnoredSocketCall(method)) {
// URI calculation logic migrated from old pointcut to maintain parity
URI methodURI = getURI();
String scheme = methodURI.getScheme();
if (scheme == null) {
scheme = conn.getProtocol().getScheme();
host = conn.getHost();
String path = methodURI.getPath();
if ("null".equals(path)) {
path = null;
}
uri = URISupport.getURI(scheme, host, conn.getPort(), path);
} else {
host = methodURI.getHost();
uri = URISupport.getURI(methodURI.getScheme(), host, conn.getPort(), methodURI.getPath());
}
// Set cross process headers for this outbound request
method.addOutboundRequestHeaders(new OutboundWrapper(this));
}
int responseCode = Weaver.callOriginal();
if (!checkForIgnoredSocketCall(method) && uri != null) {
try {
InboundWrapper inboundHeaders = new InboundWrapper(this);
java.net.URI netURI = java.net.URI.create(uri);
method.reportAsExternal(HttpParameters.library(LIBRARY).uri(netURI).procedure("execute").inboundHeaders(inboundHeaders).status(responseCode, this.getStatusText()).build());
} catch (Throwable e) {
AgentBridge.getAgent().getLogger().log(Level.FINER, e, "Unable to reportAsExternal for execute()");
}
}
return responseCode;
}
Aggregations