-
Notifications
You must be signed in to change notification settings - Fork 586
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
Add an agent plugin to support tomcat10.x(#7420) #286
Conversation
...n/src/main/java/org/apache/skywalking/apm/plugin/tomcat78x/define/TomcatInstrumentation.java
Show resolved
Hide resolved
...-10x-plugin/src/main/java/org/apache/skywalking/apm/plugin/tomcat10x/ForwardInterceptor.java
Show resolved
Hide resolved
...-10x-plugin/src/main/java/org/apache/skywalking/apm/plugin/tomcat10x/ForwardInterceptor.java
Show resolved
Hide resolved
...-10x-plugin/src/main/java/org/apache/skywalking/apm/plugin/tomcat10x/TomcatPluginConfig.java
Show resolved
Hide resolved
...n/src/main/java/org/apache/skywalking/apm/plugin/tomcat10x/define/TomcatInstrumentation.java
Show resolved
Hide resolved
I couldn't find a more suitable way to configure witness class, most of the changes in tomcat10 are about javax to jakarta. So I can only think of a combination of |
|
.../org/apache/skywalking/apm/plugin/tomcat10x/define/ApplicationDispatcherInstrumentation.java
Outdated
Show resolved
Hide resolved
...n/src/main/java/org/apache/skywalking/apm/plugin/tomcat78x/define/TomcatInstrumentation.java
Outdated
Show resolved
Hide resolved
.../org/apache/skywalking/apm/plugin/tomcat78x/define/ApplicationDispatcherInstrumentation.java
Outdated
Show resolved
Hide resolved
I don't know why some checks were not successful. Please give me some advice. |
public class CaseServlet extends HttpServlet { | ||
|
||
@Override | ||
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should add an HTTP client here to call the doPost
method. Then we could check whether you handle the context propagation correctly in the plugin.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How can I change this? I didn't understand.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You need to change the case to
Tomcat(get) -> A HTTP client call -> Tomcat(post)
Then you would have two segments, with one reference created by post because its peer client gets traced too.
I think that is just a stable CI's fault. It is not relative to your codes. I just rerun and passed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can confirm the image is with desired tomcat version 10.2.22
Co-authored-by: kezhenxu94 <kezhenxu94@apache.org>
@kezhenxu94 The approved was dismissed, maybe need a new approve |
Don't worry. Every time, you commit a new one, it would dismiss the previous approval. |
apm-sniffer/apm-sdk-plugin/pom.xml
Outdated
@@ -34,6 +34,7 @@ | |||
<module>jedis-2.x-plugin</module> | |||
<module>redisson-3.x-plugin</module> | |||
<module>tomcat-7.x-8.x-plugin</module> | |||
<module>tomcat-10x-plugin</module> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are 2 tabs here, which should be indented with 4 spaces
It seems that there are still some problems in my expectedData.yaml. I will fix them tomorrow morning. |
private static final String GET_STATUS_METHOD = "getStatus"; | ||
|
||
static { | ||
IS_SERVLET_GET_STATUS_METHOD_EXIST = MethodUtil.isMethodExist( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we need to check this method for Tomcat 10. According to the spec, getStutus
is introduced from servlet API 3.0. But the jakarta
migration happened from 4.0.2
.
I cannot see the possibility that this method is missing here. @kezhenxu94 @yswdqz @wu-sheng
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I think it is safe to remove this.
Add an agent plugin to support tomcat10.x
Add a test case for the new plugin, refer to the doc
Add a component id in the component-libraries.yml——(Already exists)
Add a logo in the UI repo——(Already exists)
If this pull request closes/resolves/fixes an existing issue, replace the issue number. Close Add plugin for Tomcat 10(Jakarta) skywalking#7420.
Update the
CHANGES
log.