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.
MODIFY
dd-java-agent/instrumentation/elasticsearch-rest-5/elasticsearch-rest-5.gradle
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'

MODIFY
dd-java-agent/instrumentation/elasticsearch-rest-5/src/latestDepTest/groovy/Elasticsearch6RestClientTest.groovy
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"

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.