Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import static net.bytebuddy.matcher.ElementMatchers.declaresMethod;
import static net.bytebuddy.matcher.ElementMatchers.isAnnotatedWith;
import static net.bytebuddy.matcher.ElementMatchers.isDeclaredBy;
import static net.bytebuddy.matcher.ElementMatchers.isMethod;
import static net.bytebuddy.matcher.ElementMatchers.namedOneOf;
import static net.bytebuddy.matcher.ElementMatchers.none;
import static net.bytebuddy.matcher.ElementMatchers.not;
Expand Down Expand Up @@ -109,7 +110,7 @@ public ElementMatcher<TypeDescription> typeMatcher() {
@Override
public void transform(TypeTransformer transformer) {
transformer.applyAdviceToMethod(
isAnnotatedWith(traceAnnotationMatcher).and(not(excludedMethodsMatcher)),
isAnnotatedWith(traceAnnotationMatcher).and(not(excludedMethodsMatcher)).and(isMethod()),
ExternalAnnotationInstrumentation.class.getName() + "$ExternalAnnotationAdvice");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@
@SuppressWarnings("UnnecessarilyFullyQualified")
public class SayTracedHello {

public SayTracedHello() {}

// used to verify that constructor with tracing annotation doesn't break instrumentation
@com.appoptics.api.ext.LogMethod
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

most, if not all, of the other tracing annotations don't apply to constructors

public SayTracedHello(String unused) {}

@com.appoptics.api.ext.LogMethod
public String appoptics() {
Span.current().setAttribute("providerAttr", "AppOptics");
Expand Down
Loading