Misc fixes.
This commit is contained in:
parent
71101ac8d0
commit
fc9f1d120c
|
@ -11,7 +11,6 @@ import io.opentracing.tag.Tags
|
||||||
import spock.lang.Shared
|
import spock.lang.Shared
|
||||||
|
|
||||||
class AkkaHttpClientInstrumentationTest extends HttpClientTest<AkkaHttpClientDecorator> {
|
class AkkaHttpClientInstrumentationTest extends HttpClientTest<AkkaHttpClientDecorator> {
|
||||||
private static final long TIMEOUT = 10000L
|
|
||||||
|
|
||||||
@Shared
|
@Shared
|
||||||
ActorSystem system = ActorSystem.create()
|
ActorSystem system = ActorSystem.create()
|
||||||
|
|
|
@ -14,7 +14,6 @@ import scala.util.Try
|
||||||
import spock.lang.Shared
|
import spock.lang.Shared
|
||||||
|
|
||||||
class AkkaHttpClientPoolInstrumentationTest extends HttpClientTest<AkkaHttpClientDecorator> {
|
class AkkaHttpClientPoolInstrumentationTest extends HttpClientTest<AkkaHttpClientDecorator> {
|
||||||
private static final long TIMEOUT = 10000L
|
|
||||||
|
|
||||||
@Shared
|
@Shared
|
||||||
ActorSystem system = ActorSystem.create()
|
ActorSystem system = ActorSystem.create()
|
||||||
|
|
|
@ -32,6 +32,8 @@ dependencies {
|
||||||
implementation deps.autoservice
|
implementation deps.autoservice
|
||||||
|
|
||||||
testCompile project(':dd-java-agent:testing')
|
testCompile project(':dd-java-agent:testing')
|
||||||
|
testCompile project(':dd-java-agent:instrumentation:java-concurrent')
|
||||||
|
|
||||||
testCompile group: 'org.apache.httpcomponents', name: 'httpasyncclient', version: '4.0'
|
testCompile group: 'org.apache.httpcomponents', name: 'httpasyncclient', version: '4.0'
|
||||||
|
|
||||||
latestDepTestCompile group: 'org.apache.httpcomponents', name: 'httpasyncclient', version: '+'
|
latestDepTestCompile group: 'org.apache.httpcomponents', name: 'httpasyncclient', version: '+'
|
||||||
|
|
|
@ -2,15 +2,15 @@ import org.apache.http.client.methods.HttpRequestBase
|
||||||
|
|
||||||
class HttpUriRequest extends HttpRequestBase {
|
class HttpUriRequest extends HttpRequestBase {
|
||||||
|
|
||||||
private final String methodName;
|
private final String methodName
|
||||||
|
|
||||||
HttpUriRequest(final String methodName, final URI uri) {
|
HttpUriRequest(final String methodName, final URI uri) {
|
||||||
this.methodName = methodName;
|
this.methodName = methodName
|
||||||
setURI(uri);
|
setURI(uri)
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
String getMethod() {
|
String getMethod() {
|
||||||
return methodName;
|
return methodName
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,15 +2,15 @@ import org.apache.http.client.methods.HttpRequestBase
|
||||||
|
|
||||||
class HttpUriRequest extends HttpRequestBase {
|
class HttpUriRequest extends HttpRequestBase {
|
||||||
|
|
||||||
private final String methodName;
|
private final String methodName
|
||||||
|
|
||||||
HttpUriRequest(final String methodName, final URI uri) {
|
HttpUriRequest(final String methodName, final URI uri) {
|
||||||
this.methodName = methodName;
|
this.methodName = methodName
|
||||||
setURI(uri);
|
setURI(uri)
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
String getMethod() {
|
String getMethod() {
|
||||||
return methodName;
|
return methodName
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,7 +16,7 @@ class SpringRestTemplateTest extends HttpClientTest<HttpUrlConnectionDecorator>
|
||||||
int doRequest(String method, URI uri, Map<String, String> headers, Closure callback) {
|
int doRequest(String method, URI uri, Map<String, String> headers, Closure callback) {
|
||||||
def httpHeaders = new HttpHeaders()
|
def httpHeaders = new HttpHeaders()
|
||||||
headers.each { httpHeaders.put(it.key, [it.value]) }
|
headers.each { httpHeaders.put(it.key, [it.value]) }
|
||||||
def request = new HttpEntity<String>(httpHeaders);
|
def request = new HttpEntity<String>(httpHeaders)
|
||||||
ResponseEntity<String> response = restTemplate.exchange(uri, HttpMethod.resolve(method), request, String)
|
ResponseEntity<String> response = restTemplate.exchange(uri, HttpMethod.resolve(method), request, String)
|
||||||
callback?.call()
|
callback?.call()
|
||||||
return response.statusCode.value()
|
return response.statusCode.value()
|
||||||
|
|
|
@ -60,7 +60,7 @@ class TraceUtils {
|
||||||
}
|
}
|
||||||
|
|
||||||
@SneakyThrows
|
@SneakyThrows
|
||||||
static <T extends Object> Object withConfigOverride(final String name, final String value, final Callable<T> r) {
|
synchronized static <T extends Object> Object withConfigOverride(final String name, final String value, final Callable<T> r) {
|
||||||
def existingConfig = Config.get() // We can't reference INSTANCE directly or the reflection below will fail.
|
def existingConfig = Config.get() // We can't reference INSTANCE directly or the reflection below will fail.
|
||||||
Properties properties = new Properties()
|
Properties properties = new Properties()
|
||||||
properties.put(name, value)
|
properties.put(name, value)
|
||||||
|
|
|
@ -100,8 +100,8 @@ public class Config {
|
||||||
parseIntegerRangeSet("500-599", "default");
|
parseIntegerRangeSet("500-599", "default");
|
||||||
private static final Set<Integer> DEFAULT_HTTP_CLIENT_ERROR_STATUSES =
|
private static final Set<Integer> DEFAULT_HTTP_CLIENT_ERROR_STATUSES =
|
||||||
parseIntegerRangeSet("400-499", "default");
|
parseIntegerRangeSet("400-499", "default");
|
||||||
private static final boolean DEFAULT_HTTP_SERVER_TAG_QUERY_STRING = true;
|
private static final boolean DEFAULT_HTTP_SERVER_TAG_QUERY_STRING = false;
|
||||||
private static final boolean DEFAULT_HTTP_CLIENT_TAG_QUERY_STRING = true;
|
private static final boolean DEFAULT_HTTP_CLIENT_TAG_QUERY_STRING = false;
|
||||||
private static final boolean DEFAULT_HTTP_CLIENT_SPLIT_BY_DOMAIN = false;
|
private static final boolean DEFAULT_HTTP_CLIENT_SPLIT_BY_DOMAIN = false;
|
||||||
private static final int DEFAULT_PARTIAL_FLUSH_MIN_SPANS = 1000;
|
private static final int DEFAULT_PARTIAL_FLUSH_MIN_SPANS = 1000;
|
||||||
private static final String DEFAULT_PROPAGATION_STYLE_EXTRACT = PropagationStyle.DATADOG.name();
|
private static final String DEFAULT_PROPAGATION_STYLE_EXTRACT = PropagationStyle.DATADOG.name();
|
||||||
|
|
Loading…
Reference in New Issue