java-agent
java-agent copied to clipboard
Move most of the code out of .btm files
i.e. below is way too much code to put there, it can be moved into some helper class where code can be checked at compile time and unit tested.
associateSpan($0, getTracer().buildSpan($0.getRequestMethod())
.withTag(io.opentracing.tag.Tags.SPAN_KIND.getKey(), io.opentracing.tag.Tags.SPAN_KIND_CLIENT)
+ .withTag(io.opentracing.tag.Tags.HTTP_URL.getKey(), $0.getURL().toString())
+ .withTag("http.query", $0.getURL().getQuery())
+ .asChildOf(currentSpan())
+ .start());
+ getTracer().inject(retrieveSpan($0).context(), io.opentracing.propagation.Format$Builtin.HTTP_HEADERS,
+ new io.opentracing.contrib.agent.jnet.propagation.HttpURLConnectionInjectAdapter($0));