Skip to content

Commit

Permalink
post merge fix
Browse files Browse the repository at this point in the history
  • Loading branch information
richardstartin committed Apr 30, 2020
1 parent 10dca37 commit 3c9d105
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 14 deletions.
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
package datadog.trace.instrumentation.java.concurrent;

import static datadog.trace.agent.tooling.bytebuddy.matcher.DDElementMatchers.implementsInterface;
import static net.bytebuddy.matcher.ElementMatchers.any;
import static net.bytebuddy.matcher.ElementMatchers.named;

import datadog.trace.agent.tooling.Instrumenter;
import datadog.trace.api.Config;
import lombok.extern.slf4j.Slf4j;
import net.bytebuddy.description.type.TypeDescription;
import net.bytebuddy.matcher.ElementMatcher;

import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.HashSet;
import java.util.Set;
import java.util.concurrent.Executor;

import static datadog.trace.agent.tooling.bytebuddy.matcher.DDElementMatchers.implementsInterface;
import static net.bytebuddy.matcher.ElementMatchers.any;
import static net.bytebuddy.matcher.ElementMatchers.named;
import lombok.extern.slf4j.Slf4j;
import net.bytebuddy.description.type.TypeDescription;
import net.bytebuddy.matcher.ElementMatcher;

@Slf4j
public abstract class AbstractExecutorInstrumentation extends Instrumenter.Default {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@ public static void onHttpCodecFilterExit(FilterChainContext ctx, HttpHeader http
HttpRequestPacket httpRequest = (HttpRequestPacket) httpHeader;
HttpResponsePacket httpResponse = httpRequest.getResponse();
AgentSpan span = startSpan("http.request", propagate().extract(httpHeader, GETTER));
AgentScope scope = activateSpan(span).setAsyncPropagation(true);
AgentScope scope = activateSpan(span);
scope.setAsyncPropagation(true);
DECORATE.afterStart(span);
ctx.getAttributes().setAttribute(SPAN, span);
ctx.getAttributes().setAttribute(RESPONSE, httpResponse);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
import com.ning.http.client.*
import com.ning.http.client.AsyncCompletionHandler
import com.ning.http.client.AsyncHttpClient
import com.ning.http.client.Request
import com.ning.http.client.RequestBuilder
import com.ning.http.client.Response
import com.ning.http.client.uri.Uri
import datadog.trace.agent.test.base.HttpClientTest
import datadog.trace.instrumentation.mulehttpconnector.client.ClientDecorator
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
import datadog.trace.agent.test.base.HttpServerTest
import datadog.trace.instrumentation.mulehttpconnector.server.ServerDecorator
import org.glassfish.grizzly.filterchain.*
import org.glassfish.grizzly.http.*
import org.glassfish.grizzly.filterchain.BaseFilter
import org.glassfish.grizzly.filterchain.FilterChain
import org.glassfish.grizzly.filterchain.FilterChainContext
import org.glassfish.grizzly.filterchain.NextAction
import org.glassfish.grizzly.filterchain.TransportFilter
import org.glassfish.grizzly.http.HttpContent
import org.glassfish.grizzly.http.HttpHeader
import org.glassfish.grizzly.http.HttpRequestPacket
import org.glassfish.grizzly.http.HttpResponsePacket
import org.glassfish.grizzly.http.HttpServerFilter
import org.glassfish.grizzly.http.server.HttpServer
import org.glassfish.grizzly.nio.transport.TCPNIOServerConnection
import org.glassfish.grizzly.nio.transport.TCPNIOTransport
Expand All @@ -11,7 +19,14 @@ import org.glassfish.grizzly.utils.IdleTimeoutFilter

import java.util.concurrent.Executors

import static datadog.trace.agent.test.base.HttpServerTest.ServerEndpoint.*
import static datadog.trace.agent.test.base.HttpServerTest.ServerEndpoint.AUTH_REQUIRED
import static datadog.trace.agent.test.base.HttpServerTest.ServerEndpoint.ERROR
import static datadog.trace.agent.test.base.HttpServerTest.ServerEndpoint.EXCEPTION
import static datadog.trace.agent.test.base.HttpServerTest.ServerEndpoint.NOT_FOUND
import static datadog.trace.agent.test.base.HttpServerTest.ServerEndpoint.PATH_PARAM
import static datadog.trace.agent.test.base.HttpServerTest.ServerEndpoint.QUERY_PARAM
import static datadog.trace.agent.test.base.HttpServerTest.ServerEndpoint.REDIRECT
import static datadog.trace.agent.test.base.HttpServerTest.ServerEndpoint.SUCCESS
import static java.lang.String.valueOf
import static java.nio.charset.Charset.defaultCharset
import static java.util.concurrent.TimeUnit.MILLISECONDS
Expand Down Expand Up @@ -173,7 +188,7 @@ class GrizzlyFilterchainServerTest extends HttpServerTest<HttpServer> {
byte[] responseBody

ResponseParameters(HttpServerTest.ServerEndpoint endpoint,
status,
int status,
byte[] responseBody,
Map<String, String> headers) {
this.endpoint = endpoint
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ public static AgentSpan startSpan(

/**
* Activates the span without finishing on closing the active scope
*
* @param span the span to activate
* @return a newly activated scope
*/
Expand Down

0 comments on commit 3c9d105

Please sign in to comment.