xuanyu66 opened a new issue #6105:
URL: https://github.com/apache/skywalking/issues/6105
Please answer these questions before submitting your issue.
- Why do you submit this issue?
- [ ] Question or discussion
___
### Question
- What do you want to know?
We want to unload agent without restarting our application.Maybe it's not
proper to use "unload". It's something like agent's switch at runtime
I read code and figure out that these are 5 class which are actual
byte-buddy's interceptor to intercept class instance methods.
- StaticMethodsInter
- InstMethodsInter
- InstMethodsInterWithOverrideArgs
- ConstructorInter
- StaticMethodsInterWithOverrideArgs
So I decide to add some if/else statement to control whether to execute
plugin's logic, such as beforeMethod() in class
InstanceMethodsAroundInterceptor.
I want to know is it appropriate to do in this way? Is there a better way to
do?
Anyway, we will maintain code ourselves.
```
try {
if(tracingEnable) {
interceptor.beforeMethod(targetObject, method, allArguments,
method.getParameterTypes(), result);
}
} catch (Throwable t) {
LOGGER.error(t, "class[{}] before method[{}] intercept failure",
obj.getClass(), method.getName());
}
```
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]