@Test public void canTracePublishRequestError() { PublishRequest publishRequest = new PublishRequest("topic", "1234"); Request request = new DefaultRequest(publishRequest, "amazon-sns"); handler.afterError(request, null, new Exception("Aw, snap!")); assertEquals( 1, spans.size() ); assertEquals(spans.getFirst().tags().get("error"), "Aw, snap!"); }
@Override public void afterError(Request<?> request, Response<?> response, Exception e) { if (request.getOriginalRequestObject() instanceof PublishRequest) { Span span = tracing.tracer().nextSpan() .remoteEndpoint(Endpoint.newBuilder().serviceName(SERVICE_NAME).build()) .kind(Span.Kind.CLIENT) .start(); span.tag("error", e.getMessage()); span.flush(); } }
PublishRequestTracingHandler extends RequestHandler2 { @Override public void afterError(Request<?> request, Response<?> response, Exception e) { if (request.getOriginalRequestObject() instanceof PublishRequest) { Span span = tracing.tracer().nextSpan() .remoteEndpoint(Endpoint.newBuilder().serviceName(SERVICE_NAME).build()) .kind(Span.Kind.CLIENT) .start(); span.tag("error", e.getMessage()); span.flush(); } } }
PublishRequestTracingHandler extends RequestHandler2 { @Override public void afterError(Request<?> request, Response<?> response, Exception e) { if (request.getOriginalRequestObject() instanceof PublishRequest) { Span span = tracing.tracer().nextSpan() .remoteEndpoint(Endpoint.newBuilder().serviceName(SERVICE_NAME).build()) .kind(Span.Kind.CLIENT) .start(); span.tag("error", e.getMessage()); span.flush(); } } PublishRequestTracingHandler(Tracing tracing); }
PublishRequestTracingHandler extends RequestHandler2 { @Override public void afterError(Request<?> request, Response<?> response, Exception e) { if (request.getOriginalRequestObject() instanceof PublishRequest) { Span span = tracing.tracer().nextSpan() .remoteEndpoint(Endpoint.newBuilder().serviceName(SERVICE_NAME).build()) .kind(Span.Kind.CLIENT) .start(); span.tag("error", e.getMessage()); span.flush(); } } PublishRequestTracingHandler(Tracing tracing); @Override void afterError(Request<?> request, Response<?> response, Exception e); @Override AmazonWebServiceRequest beforeMarshalling(AmazonWebServiceRequest request); @Override void afterResponse(Request<?> request, Response<?> response); }
PublishRequestTracingHandler extends RequestHandler2 { @Override public void afterError(Request<?> request, Response<?> response, Exception e) { if (request.getOriginalRequestObject() instanceof PublishRequest) { Span span = tracing.tracer().nextSpan() .remoteEndpoint(Endpoint.newBuilder().serviceName(SERVICE_NAME).build()) .kind(Span.Kind.CLIENT) .start(); span.tag("error", e.getMessage()); span.flush(); } } PublishRequestTracingHandler(Tracing tracing); @Override void afterError(Request<?> request, Response<?> response, Exception e); @Override AmazonWebServiceRequest beforeMarshalling(AmazonWebServiceRequest request); @Override void afterResponse(Request<?> request, Response<?> response);  }