Remove OperationDecorator
MODIFY
dd-java-agent/instrumentation/aws-java-sdk-1.11.0/src/main/java/datadog/trace/instrumentation/aws/v0/TracingRequestHandler.java
dd-java-agent/instrumentation/aws-java-sdk-1.11.0/src/main/java/datadog/trace/instrumentation/aws/v0/TracingRequestHandler.java
@@ -29,7 +29,7 @@ public class TracingRequestHandler extends RequestHandler2 {
@Override
public void beforeRequest(final Request<?> request) {
- final AgentSpan span = startSpan("aws.command");
+ final AgentSpan span = startSpan("aws.http");
decorate.afterStart(span);
decorate.onRequest(span, request);
request.addHandlerContext(SCOPE_CONTEXT_KEY, activateSpan(span, true));

RENAME
dd-java-agent/instrumentation/aws-java-sdk-1.11.0/src/test/groovy/AWSClientTest.groovy
dd-java-agent/instrumentation/aws-java-sdk-1.11.0/src/test/groovy/AWS1ClientTest.groovy
@@ -42,7 +42,7 @@ import static datadog.trace.agent.test.server.http.TestHttpServer.httpServer
import static datadog.trace.agent.test.utils.PortUtils.UNUSABLE_PORT
import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.activeSpan
-class AWSClientTest extends AgentTestRunner {
+class AWS1ClientTest extends AgentTestRunner {
private static final CREDENTIALS_PROVIDER_CHAIN = new AWSCredentialsProviderChain(
new EnvironmentVariableCredentialsProvider(),

RENAME
dd-java-agent/instrumentation/aws-java-sdk-1.11.0/src/test_before_1_11_106/groovy/AWSClientTest.groovy
dd-java-agent/instrumentation/aws-java-sdk-1.11.0/src/test_before_1_11_106/groovy/AWS0ClientTest.groovy
@@ -29,7 +29,7 @@ import static datadog.trace.agent.test.server.http.TestHttpServer.httpServer
import static datadog.trace.agent.test.utils.PortUtils.UNUSABLE_PORT
import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.activeSpan
-class AWSClientTest extends AgentTestRunner {
+class AWS0ClientTest extends AgentTestRunner {
private static final CREDENTIALS_PROVIDER_CHAIN = new AWSCredentialsProviderChain(
new EnvironmentVariableCredentialsProvider(),

MODIFY
dd-java-agent/instrumentation/aws-java-sdk-2.2/src/main/java8/datadog/trace/instrumentation/aws/v2/TracingExecutionInterceptor.java
dd-java-agent/instrumentation/aws-java-sdk-2.2/src/main/java8/datadog/trace/instrumentation/aws/v2/TracingExecutionInterceptor.java
@@ -29,7 +29,7 @@ public class TracingExecutionInterceptor implements ExecutionInterceptor {
@Override
public void beforeExecution(
final Context.BeforeExecution context, final ExecutionAttributes executionAttributes) {
- final AgentSpan span = startSpan("aws.command");
+ final AgentSpan span = startSpan("aws.http");
try (final AgentScope scope = activateSpan(span, false)) {
DECORATE.afterStart(span);
executionAttributes.putAttribute(SPAN_ATTRIBUTE, span);

RENAME
dd-java-agent/instrumentation/aws-java-sdk-2.2/src/test/groovy/AwsClientTest.groovy
dd-java-agent/instrumentation/aws-java-sdk-2.2/src/test/groovy/Aws2ClientTest.groovy
@@ -35,7 +35,7 @@ import java.util.concurrent.atomic.AtomicReference
import static datadog.trace.agent.test.server.http.TestHttpServer.httpServer
-class AwsClientTest extends AgentTestRunner {
+class Aws2ClientTest extends AgentTestRunner {
private static final StaticCredentialsProvider CREDENTIALS_PROVIDER = StaticCredentialsProvider
.create(AwsBasicCredentials.create("my-access-key", "my-secret-key"))

MODIFY
dd-trace-ot/src/main/java/datadog/opentracing/decorators/DDDecoratorsFactory.java
dd-trace-ot/src/main/java/datadog/opentracing/decorators/DDDecoratorsFactory.java
@@ -18,7 +18,6 @@ public class DDDecoratorsFactory {
new DBTypeDecorator(),
new ForceManualDropDecorator(),
new ForceManualKeepDecorator(),
- new OperationDecorator(),
new PeerServiceDecorator(),
new ServiceNameDecorator(),
new ServiceNameDecorator("service", false),

DELETE
dd-trace-ot/src/main/java/datadog/opentracing/decorators/OperationDecorator.java
-package datadog.opentracing.decorators;
-
-import datadog.opentracing.DDSpanContext;
-import io.opentracing.tag.Tags;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * This span decorator is a simple mapping to override the operation DB tags. The operation name of
- * DB decorators are handled by the DBTypeDecorator
- */
-public class OperationDecorator extends AbstractDecorator {
-
- static final Map<String, String> MAPPINGS;
-
- static {
- final Map<String, String> mappings = new HashMap<>();
- // Component name <> Operation name
- mappings.put("java-aws-sdk", "aws.http");
- // FIXME: JMS ops card is low (jms-send or jms-receive), may be this mapping is useless
- mappings.put("java-jms", "jms");
- // Cassandra, Mongo, JDBC are set via DBTypeDecorator
- MAPPINGS = Collections.unmodifiableMap(mappings);
- }
-
- public OperationDecorator() {
- super();
- setMatchingTag(Tags.COMPONENT.getKey());
- }
-
- @Override
- public boolean shouldSetTag(final DDSpanContext context, final String tag, final Object value) {
- if (MAPPINGS.containsKey(String.valueOf(value))) {
- context.setOperationName(MAPPINGS.get(String.valueOf(value)));
- }
- return true;
- }
-}

MODIFY
dd-trace-ot/src/test/groovy/datadog/opentracing/decorators/SpanDecoratorTest.groovy
dd-trace-ot/src/test/groovy/datadog/opentracing/decorators/SpanDecoratorTest.groovy
@@ -223,18 +223,6 @@ class SpanDecoratorTest extends DDSpecification {
span.serviceName == "peer-service"
}
- def "set operation name"() {
- when:
- Tags.COMPONENT.set(span, component)
-
- then:
- span.getOperationName() == operationName
-
- where:
- component << OperationDecorator.MAPPINGS.keySet()
- operationName << OperationDecorator.MAPPINGS.values()
- }
-
def "set resource name"() {
when:
span.setTag(DDTags.RESOURCE_NAME, name)

Remove OperationDecorator