honganan commented on a change in pull request #1913: fix bug #1912, the usage
of ignore() problem
URL:
https://github.com/apache/incubator-skywalking/pull/1913#discussion_r234148764
##########
File path:
apm-sniffer/apm-agent/src/main/java/org/apache/skywalking/apm/agent/SkyWalkingAgent.java
##########
@@ -75,12 +76,14 @@ public static void premain(String agentArgs,
Instrumentation instrumentation) th
new AgentBuilder.Default(byteBuddy)
.ignore(nameStartsWith("net.bytebuddy."))
- .ignore(nameStartsWith("org.slf4j."))
- .ignore(nameStartsWith("org.apache.logging."))
- .ignore(nameStartsWith("org.groovy."))
- .ignore(nameContains("javassist"))
- .ignore(nameContains(".asm."))
- .ignore(allSkyWalkingAgentExcludeToolkit())
+ .or(nameStartsWith("org.slf4j."))
+ .or(nameStartsWith("org.apache.logging."))
+ .or(nameStartsWith("org.groovy."))
+ .or(nameContains("javassist"))
+ .or(nameContains(".asm."))
+ .or(nameStartsWith("sun.reflect"))
+ .or(allSkyWalkingAgentExcludeToolkit()
+ .or(ElementMatchers.<TypeDescription>isSynthetic()))
Review comment:
For what I know the synthetic could also used to a class, that means
compiler can generate synthetic class.
Exactly I am not sure what kinds of scene is this for, but consult to
bytebuddy source code. It will create a default ignore when use the constructor
`public Default(ByteBuddy byteBuddy) {...}` like this(L8334 in
AgentBuilder.java):
```java
new RawMatcher.Disjunction(
new RawMatcher.ForElementMatchers(any(),
isBootstrapClassLoader()),
new
RawMatcher.ForElementMatchers(nameStartsWith("net.bytebuddy.").or(nameStartsWith("sun.reflect.")).<TypeDescription>or(isSynthetic()))),
```
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services