-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
ttl agent not working when i both use our own javaagent #207
Comments
@ffiredom PS: Sorry for my procrastinated reply... |
Because this problem occurs in the company's internal projects, we may not be able to provide specific projects, but we are based on the sky-walking agent for transformation, the reason is also very simple, that is, when our own agent wants to integrate ttlagent, we found The agent started successfully, and ttl related logs are also output, but the thread enhancement does not take effect. premain method like that: public static void premain(String agentArgs, Instrumentation instrumentation)
throws PluginException {
final PluginFinder pluginFinder;
loadTtlAgent(agentArgs, instrumentation);
try {
pluginFinder = new PluginFinder(new PluginBootstrap().loadPlugins());
} catch (Exception e) {
logger.error("enn agent initialized failure. Shutting down.", e);
return;
}
final ByteBuddy byteBuddy = new ByteBuddy()
.with(TypeValidation.of(Config.Agent.IS_OPEN_DEBUGGING_CLASS));
AgentBuilder agentBuilder = new AgentBuilder.Default(byteBuddy).ignore(
nameStartsWith("net.bytebuddy.").or(nameStartsWith("org.slf4j."))
.or(nameStartsWith("org.groovy."))
.or(nameContains("javassist"))
.or(nameContains(".asm."))
.or(nameContains(".reflectasm."))
.or(nameStartsWith("sun.reflect"))
.or(allEnvAgentExcludeToolkit())
.or(ElementMatchers.isSynthetic()));
if (Config.Agent.IS_CACHE_ENHANCED_CLASS) {
try {
agentBuilder = agentBuilder
.with(new CacheableTransformerDecorator(Config.Agent.CLASS_CACHE_MODE));
logger.info("Env agent class cache [{}] activated.", Config.Agent.CLASS_CACHE_MODE);
} catch (Exception e) {
logger.error("Env agent can't active class cache.", e);
}
}
System.out.println("start env sniffer agent");
agentBuilder.type(pluginFinder.buildMatch())
.transform(new Transformer(pluginFinder))
.with(AgentBuilder.RedefinitionStrategy.RETRANSFORMATION)
.with(new Listener())
.installOn(instrumentation);
System.out.println("env sniffer agent load success");
} |
@ffiredom similar/related problem about agent, see the discussion in issue: TTL agent 与 其他agent的兼容性问题 #226
|
@ffiredom is your problem resolved? |
我遇到一样的问题 先执行ttlagent.premain 然后在有bytebuddy的应用 增强失败 |
找到问题了 是slf4j的问题 logger.getlogger 导致的 |
when i use our own javaagent to enhance the code ,both, i could use ttl in some sence to enhance threadpool class. so i nested ttl agent in our own agent, expecting both agent to take affect.
but only using ttl agent alone will work. Below are my application startup parameters...
The ttl jar has imported in the env-sniffer jar
and premain is like that
The text was updated successfully, but these errors were encountered: