Skip to content

Implement code origin support for grpc server entry spans #7942

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Nov 27, 2024
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
PR feedback updates
  • Loading branch information
evanchooly committed Nov 27, 2024
commit 9f4aaa89a371062d9a648f201c4b8edb19d1b5e4
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import com.google.auto.service.AutoService;
import datadog.trace.agent.tooling.Instrumenter.ForTypeHierarchy;
import datadog.trace.agent.tooling.InstrumenterModule;
import datadog.trace.api.Platform;
import java.lang.reflect.Method;
import net.bytebuddy.asm.Advice;
import net.bytebuddy.description.type.TypeDescription;
Expand All @@ -33,6 +34,11 @@ public ElementMatcher<TypeDescription> hierarchyMatcher() {
return METHOD_HANDLERS;
}

@Override
public boolean isEnabled() {
return super.isEnabled() && !Platform.isGraalVM();
}

@Override
public void methodAdvice(MethodTransformer transformer) {
transformer.applyAdvice(
Expand All @@ -50,7 +56,7 @@ public static void onEnter(@Advice.Argument(0) Object serviceImpl) {
for (Method method : superclass.getDeclaredMethods()) {
try {
entry(serviceClass.getDeclaredMethod(method.getName(), method.getParameterTypes()));
} catch (NoSuchMethodException e) {
} catch (Throwable e) {
// service method not overridden on the impl. skipping instrumentation.
}
}
Expand Down
Loading