From 4199f924accf301cb1cb4fcce1fbe169f55bcd77 Mon Sep 17 00:00:00 2001 From: Tyler Benson Date: Tue, 27 Nov 2018 11:13:36 -0800 Subject: [PATCH] Remove ES-transport instrumentation from rest test It is generating an extra trace/span that in a realistic scenario would be generated by the server, not the client. --- .../elasticsearch-rest-5.gradle | 6 +----- .../Elasticsearch6RestClientTest.groovy | 19 +------------------ 2 files changed, 2 insertions(+), 23 deletions(-) diff --git a/dd-java-agent/instrumentation/elasticsearch-rest-5/elasticsearch-rest-5.gradle b/dd-java-agent/instrumentation/elasticsearch-rest-5/elasticsearch-rest-5.gradle index 147e8c7fce..8e5624cdf7 100644 --- a/dd-java-agent/instrumentation/elasticsearch-rest-5/elasticsearch-rest-5.gradle +++ b/dd-java-agent/instrumentation/elasticsearch-rest-5/elasticsearch-rest-5.gradle @@ -31,14 +31,10 @@ dependencies { implementation deps.autoservice testCompile project(':dd-java-agent:testing') - // Ensure no cross interference - testCompile project(':dd-java-agent:instrumentation:elasticsearch-transport-5') - testCompile project(':dd-java-agent:instrumentation:elasticsearch-transport-6') // Include httpclient instrumentation for testing because it is a dependency for elasticsearch-rest-client. // It doesn't actually work though. They use HttpAsyncClient, which isn't currently instrumented. - // TODO: add HttpAsyncClient instrumentation when that is complete. + // TODO: add Apache's HttpAsyncClient instrumentation when that is complete. testCompile project(':dd-java-agent:instrumentation:apache-httpclient-4') - // TODO: add netty instrumentation when that is complete. testCompile group: 'org.apache.logging.log4j', name: 'log4j-core', version: '2.11.0' testCompile group: 'org.apache.logging.log4j', name: 'log4j-api', version: '2.11.0' diff --git a/dd-java-agent/instrumentation/elasticsearch-rest-5/src/latestDepTest/groovy/Elasticsearch6RestClientTest.groovy b/dd-java-agent/instrumentation/elasticsearch-rest-5/src/latestDepTest/groovy/Elasticsearch6RestClientTest.groovy index 1fc9276a03..e5adbd878c 100644 --- a/dd-java-agent/instrumentation/elasticsearch-rest-5/src/latestDepTest/groovy/Elasticsearch6RestClientTest.groovy +++ b/dd-java-agent/instrumentation/elasticsearch-rest-5/src/latestDepTest/groovy/Elasticsearch6RestClientTest.groovy @@ -78,25 +78,8 @@ class Elasticsearch6RestClientTest extends AgentTestRunner { expect: result.status == "green" - assertTraces(2) { + assertTraces(1) { trace(0, 1) { - span(0) { - serviceName "elasticsearch" - resourceName "ClusterHealthAction" - operationName "elasticsearch.query" - spanType DDSpanTypes.ELASTICSEARCH - parent() - tags { - "$Tags.COMPONENT.key" "elasticsearch-java" - "$Tags.SPAN_KIND.key" Tags.SPAN_KIND_CLIENT - "$DDTags.SPAN_TYPE" DDSpanTypes.ELASTICSEARCH - "elasticsearch.action" "ClusterHealthAction" - "elasticsearch.request" "ClusterHealthRequest" - defaultTags() - } - } - } - trace(1, 1) { span(0) { serviceName "elasticsearch" resourceName "GET _cluster/health"