Add DataDog trace annotation
MODIFY
instrumentation/trace-annotation/src/main/java/io/opentelemetry/auto/instrumentation/traceannotation/TraceAnnotationsInstrumentation.java
instrumentation/trace-annotation/src/main/java/io/opentelemetry/auto/instrumentation/traceannotation/TraceAnnotationsInstrumentation.java
@@ -50,13 +50,14 @@ public final class TraceAnnotationsInstrumentation extends Instrumenter.Default
private static final String[] DEFAULT_ANNOTATIONS =
new String[] {
+ "com.appoptics.api.ext.LogMethod",
"com.newrelic.api.agent.Trace",
- "kamon.annotation.Trace",
- "kamon.annotation.api.Trace",
+ "com.signalfx.tracing.api.Trace",
"com.tracelytics.api.ext.LogMethod",
- "com.appoptics.api.ext.LogMethod",
+ "datadog.trace.api.Trace",
"io.opentracing.contrib.dropwizard.Trace",
- "com.signalfx.tracing.api.Trace",
+ "kamon.annotation.Trace",
+ "kamon.annotation.api.Trace",
"org.springframework.cloud.sleuth.annotation.NewSpan"
};

MODIFY
instrumentation/trace-annotation/src/test/groovy/TraceProvidersTest.groovy
instrumentation/trace-annotation/src/test/groovy/TraceProvidersTest.groovy
@@ -54,7 +54,7 @@ class TraceProvidersTest extends AgentTestRunner {
}
where:
- provider << ["Dropwizard", "NewRelic", "SignalFx", "KamonOld", "KamonNew", "AppOptics", "Tracelytics", "Sleuth"]
+ provider << ["AppOptics", "Datadog", "Dropwizard", "KamonOld", "KamonNew", "NewRelic", "SignalFx", "Sleuth", "Tracelytics"]
}
}

MODIFY
instrumentation/trace-annotation/src/test/java/io/opentelemetry/test/annotation/SayTracedHello.java
instrumentation/trace-annotation/src/test/java/io/opentelemetry/test/annotation/SayTracedHello.java
@@ -24,9 +24,9 @@ public class SayTracedHello {
private static final Tracer TRACER =
OpenTelemetry.getTracerProvider().get("io.opentelemetry.auto");
- @io.opentracing.contrib.dropwizard.Trace
- public String dropwizard() {
- TRACER.getCurrentSpan().setAttribute("providerAttr", "Dropwizard");
+ @com.appoptics.api.ext.LogMethod
+ public String appoptics() {
+ TRACER.getCurrentSpan().setAttribute("providerAttr", "AppOptics");
return "hello!";
}
@@ -36,33 +36,39 @@ public class SayTracedHello {
return "hello!";
}
- @kamon.annotation.Trace("spanName")
- public String kamonold() {
- TRACER.getCurrentSpan().setAttribute("providerAttr", "KamonOld");
+ @com.signalfx.tracing.api.Trace
+ public String signalfx() {
+ TRACER.getCurrentSpan().setAttribute("providerAttr", "SignalFx");
return "hello!";
}
- @kamon.annotation.api.Trace
- public String kamonnew() {
- TRACER.getCurrentSpan().setAttribute("providerAttr", "KamonNew");
+ @com.tracelytics.api.ext.LogMethod
+ public String tracelytics() {
+ TRACER.getCurrentSpan().setAttribute("providerAttr", "Tracelytics");
return "hello!";
}
- @com.appoptics.api.ext.LogMethod
- public String appoptics() {
- TRACER.getCurrentSpan().setAttribute("providerAttr", "AppOptics");
+ @datadog.trace.api.Trace
+ public String datadog() {
+ TRACER.getCurrentSpan().setAttribute("providerAttr", "Datadog");
return "hello!";
}
- @com.tracelytics.api.ext.LogMethod
- public String tracelytics() {
- TRACER.getCurrentSpan().setAttribute("providerAttr", "Tracelytics");
+ @io.opentracing.contrib.dropwizard.Trace
+ public String dropwizard() {
+ TRACER.getCurrentSpan().setAttribute("providerAttr", "Dropwizard");
return "hello!";
}
- @com.signalfx.tracing.api.Trace
- public String signalfx() {
- TRACER.getCurrentSpan().setAttribute("providerAttr", "SignalFx");
+ @kamon.annotation.Trace("spanName")
+ public String kamonold() {
+ TRACER.getCurrentSpan().setAttribute("providerAttr", "KamonOld");
+ return "hello!";
+ }
+
+ @kamon.annotation.api.Trace
+ public String kamonnew() {
+ TRACER.getCurrentSpan().setAttribute("providerAttr", "KamonNew");
return "hello!";
}

Add DataDog trace annotation (#361)