java-agent icon indicating copy to clipboard operation
java-agent copied to clipboard

Move most of the code out of .btm files

Open yurishkuro opened this issue 8 years ago • 0 comments

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));

yurishkuro avatar Mar 09 '17 18:03 yurishkuro