Search in sources :

Example 81 with Segment

use of com.newrelic.api.agent.Segment in project newrelic-java-agent by newrelic.

the class S3AsyncClient_Instrumentation method getObject.

public <ReturnT> CompletableFuture<ReturnT> getObject(GetObjectRequest getObjectRequest, AsyncResponseTransformer asyncResponseTransformer) {
    String uri = "s3://" + getObjectRequest.bucket() + "/" + getObjectRequest.key();
    Segment segment = NewRelic.getAgent().getTransaction().startSegment("S3", "getObject");
    AgentBridge.getAgent().getTracedMethod().setTrackChildThreads(false);
    CompletableFuture<ReturnT> result = Weaver.callOriginal();
    return result.whenComplete(new ResultWrapper<>(segment));
}
Also used : Segment(com.newrelic.api.agent.Segment)

Example 82 with Segment

use of com.newrelic.api.agent.Segment in project newrelic-java-agent by newrelic.

the class S3AsyncClient_Instrumentation method listObjects.

public CompletableFuture<ListObjectsResponse> listObjects(ListObjectsRequest listObjectsRequest) {
    String uri = "s3://" + listObjectsRequest.bucket();
    Segment segment = NewRelic.getAgent().getTransaction().startSegment("S3", "listObjects");
    AgentBridge.getAgent().getTracedMethod().setTrackChildThreads(false);
    CompletableFuture<ListObjectsResponse> result = Weaver.callOriginal();
    return result.whenComplete(new S3ResponseResultWrapper<>(segment, uri, "listObjects"));
}
Also used : ListObjectsResponse(software.amazon.awssdk.services.s3.model.ListObjectsResponse) Segment(com.newrelic.api.agent.Segment)

Example 83 with Segment

use of com.newrelic.api.agent.Segment in project newrelic-java-agent by newrelic.

the class S3AsyncClient_Instrumentation method getBucketLocation.

public CompletableFuture<GetBucketLocationResponse> getBucketLocation(GetBucketLocationRequest getBucketLocationRequest) {
    String uri = "s3://" + getBucketLocationRequest.bucket();
    Segment segment = NewRelic.getAgent().getTransaction().startSegment("S3", "getBucketLocation");
    AgentBridge.getAgent().getTracedMethod().setTrackChildThreads(false);
    CompletableFuture<GetBucketLocationResponse> result = Weaver.callOriginal();
    return result.whenComplete(new S3ResponseResultWrapper<>(segment, uri, "getBucketLocation"));
}
Also used : GetBucketLocationResponse(software.amazon.awssdk.services.s3.model.GetBucketLocationResponse) Segment(com.newrelic.api.agent.Segment)

Example 84 with Segment

use of com.newrelic.api.agent.Segment in project newrelic-java-agent by newrelic.

the class S3AsyncClient_Instrumentation method deleteObjects.

public CompletableFuture<DeleteObjectsResponse> deleteObjects(DeleteObjectsRequest deleteObjectsRequest) {
    String uri = "s3://" + deleteObjectsRequest.bucket();
    Segment segment = NewRelic.getAgent().getTransaction().startSegment("S3", "deleteObjects");
    AgentBridge.getAgent().getTracedMethod().setTrackChildThreads(false);
    CompletableFuture<DeleteObjectsResponse> result = Weaver.callOriginal();
    return result.whenComplete(new S3ResponseResultWrapper<>(segment, uri, "deleteObjects"));
}
Also used : DeleteObjectsResponse(software.amazon.awssdk.services.s3.model.DeleteObjectsResponse) Segment(com.newrelic.api.agent.Segment)

Example 85 with Segment

use of com.newrelic.api.agent.Segment in project newrelic-java-agent by newrelic.

the class HttpExtInstrumentation method singleRequest.

public Future<HttpResponse> singleRequest(HttpRequest httpRequest, HttpsConnectionContext connectionContext, ConnectionPoolSettings poolSettings, LoggingAdapter loggingAdapter) {
    final Segment segment = NewRelic.getAgent().getTransaction().startSegment("Akka", "singleRequest");
    Future<HttpResponse> responseFuture = Weaver.callOriginal();
    AkkaHttpUtils.finishSegmentOnComplete(httpRequest, responseFuture, segment);
    return responseFuture;
}
Also used : HttpResponse(akka.http.scaladsl.model.HttpResponse) Segment(com.newrelic.api.agent.Segment)

Aggregations

Segment (com.newrelic.api.agent.Segment)138 Trace (com.newrelic.api.agent.Trace)13 URI (java.net.URI)6 NoOpSegment (com.newrelic.agent.bridge.NoOpSegment)5 URISyntaxException (java.net.URISyntaxException)4 HttpResponse (akka.http.scaladsl.model.HttpResponse)3 Transaction (com.newrelic.agent.bridge.Transaction)3 DatastoreParameters (com.newrelic.api.agent.DatastoreParameters)3 ExternalParameters (com.newrelic.api.agent.ExternalParameters)3 InetSocketAddress (java.net.InetSocketAddress)3 Test (org.junit.Test)3 Transaction (com.newrelic.agent.Transaction)2 MessageProduceParameters (com.newrelic.api.agent.MessageProduceParameters)2 Transaction (com.newrelic.api.agent.Transaction)2 OutboundWrapper (com.nr.agent.instrumentation.asynchttpclient.OutboundWrapper)2 HelloReply (io.grpc.examples.helloworld.HelloReply)2 HelloRequest (io.grpc.examples.helloworld.HelloRequest)2 IOException (java.io.IOException)2 SocketAddress (java.net.SocketAddress)2 MemcachedNode (net.spy.memcached.MemcachedNode)2