List of usage examples for com.amazonaws Request addHandlerContext
<X> void addHandlerContext(HandlerContextKey<X> key, X value);
From source file:io.opentracing.contrib.aws.TracingRequestHandler.java
License:Apache License
/** * {@inheritDoc}//from w ww. j av a2 s .c om */ @Override public void beforeRequest(Request<?> request) { Tracer.SpanBuilder spanBuilder = tracer.buildSpan(request.getOriginalRequest().getClass().getSimpleName()) .withTag(Tags.SPAN_KIND.getKey(), Tags.SPAN_KIND_CLIENT); if (parentContext != null) { spanBuilder.asChildOf(parentContext); } Span span = spanBuilder.start(); SpanDecorator.onRequest(request, span); tracer.inject(span.context(), Format.Builtin.HTTP_HEADERS, new TextMapAdapter(request.getHeaders())); request.addHandlerContext(contextKey, span); }