Search in sources :

Example 61 with Segment

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

the class S3AsyncClient_Instrumentation method putObject.

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

Example 62 with Segment

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

the class S3AsyncClient_Instrumentation method deleteObject.

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

Example 63 with Segment

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

the class S3AsyncClient_Instrumentation method listBuckets.

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

Example 64 with Segment

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

the class S3AsyncClient_Instrumentation method deleteBucket.

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

Example 65 with Segment

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

the class AmazonSNSAsync_Instrumentation method startSegment.

private Segment startSegment(PublishRequest publishRequest, Transaction transaction) {
    final Segment segment = transaction.startSegment("SNS");
    MessageProduceParameters params = SNSInstrumentationHelper.makeMessageProducerParameters(publishRequest);
    segment.reportAsExternal(params);
    return segment;
}
Also used : MessageProduceParameters(com.newrelic.api.agent.MessageProduceParameters) 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