-
Notifications
You must be signed in to change notification settings - Fork 679
Add support gRPC 1.59.x and 1.70.x server interceptor trace #764
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
Changes from 2 commits
c54f287
fe5cd51
0c88fa9
7288e2e
89206ee
956c9a5
4551e27
cd4bf58
5a0b960
fa3ff02
0f3dc3c
0653a43
9677d03
29a1f0a
303ffd4
611071a
3b5f02f
bd35702
22b38a6
3e9fd79
797d850
d0ed0a7
5dd664e
a6b609f
13fa3d4
0b3f5a0
1975779
fafe941
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -24,17 +24,13 @@ | |
| import org.apache.skywalking.apm.agent.core.plugin.interceptor.InstanceMethodsInterceptPoint; | ||
| import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.ClassInstanceMethodsEnhancePluginDefine; | ||
| import org.apache.skywalking.apm.agent.core.plugin.match.ClassMatch; | ||
| import org.apache.skywalking.apm.agent.core.plugin.match.MultiClassNameMatch; | ||
|
|
||
| import static net.bytebuddy.matcher.ElementMatchers.named; | ||
| import static net.bytebuddy.matcher.ElementMatchers.takesNoArguments; | ||
| import static org.apache.skywalking.apm.agent.core.plugin.match.NameMatch.byName; | ||
|
|
||
| public class AbstractServerImplBuilderInstrumentation extends ClassInstanceMethodsEnhancePluginDefine { | ||
|
|
||
| public static final String ENHANCE_CLASS = "io.grpc.internal.AbstractServerImplBuilder"; | ||
| public static final String ENHANCE_METHOD = "build"; | ||
| public static final String INTERCEPT_CLASS = "org.apache.skywalking.apm.plugin.grpc.v1.server.AbstractServerImplBuilderInterceptor"; | ||
|
|
||
| @Override | ||
| public ConstructorInterceptPoint[] getConstructorsInterceptPoints() { | ||
| return new ConstructorInterceptPoint[0]; | ||
|
|
@@ -46,12 +42,12 @@ public InstanceMethodsInterceptPoint[] getInstanceMethodsInterceptPoints() { | |
| new InstanceMethodsInterceptPoint() { | ||
| @Override | ||
| public ElementMatcher<MethodDescription> getMethodsMatcher() { | ||
| return named(ENHANCE_METHOD).and(takesNoArguments()); | ||
| return named("build").and(takesNoArguments()); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why do you change this?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just keep this class using local variables
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I can't see the point of changing this. Please follow original style.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. done |
||
| } | ||
|
|
||
| @Override | ||
| public String getMethodsInterceptor() { | ||
| return INTERCEPT_CLASS; | ||
| return "org.apache.skywalking.apm.plugin.grpc.v1.server.AbstractServerImplBuilderInterceptor"; | ||
| } | ||
|
|
||
| @Override | ||
|
|
@@ -64,6 +60,9 @@ public boolean isOverrideArgs() { | |
|
|
||
| @Override | ||
| protected ClassMatch enhanceClass() { | ||
| return byName(ENHANCE_CLASS); | ||
| return MultiClassNameMatch.byMultiClassMatch( | ||
| "io.grpc.internal.AbstractServerImplBuilder", | ||
| "io.grpc.internal.ServerImplBuilder", | ||
| "io.grpc.internal.ForwardingServerBuilder"); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Are these for different versions? If so, please add comments to the codes. |
||
| } | ||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.