-
Notifications
You must be signed in to change notification settings - Fork 1k
Add support for JFinal #15216
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
base: main
Are you sure you want to change the base?
Add support for JFinal #15216
Conversation
Change-Id: Ia3b5f6b74b40763c4df7fa0185223575a2c1b068
Change-Id: I39d2ce579c60d5afa2e792f3296eef5d0b495443
…r' into feature/additonal-jdbc-url-parser Change-Id: I5b6ee06da60fc32dc1edece63948d228c95f710b
Change-Id: Ic7a1bdab51668642fb2c3e4b775ce30f4e1a841c
…r' into feature/additonal-jdbc-url-parser Change-Id: I6205bbedb81199c2bded7b78112389ca0b935636
Change-Id: Ie9d2a16071e77ce12f386227faaff4a4927512be
|
🔧 The result from spotlessApply was committed to the PR branch. |
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.
Pull Request Overview
This PR adds OpenTelemetry Java agent instrumentation support for JFinal 3.6, a lightweight Java MVC framework. The instrumentation enables automatic tracing of HTTP requests handled by JFinal applications.
Key changes:
- Implements instrumentation for JFinal's ActionHandler and ActionMapping components to create spans and capture HTTP routes
- Adds comprehensive test coverage including various HTTP endpoints, error handling, and span relationship validation
- Excludes OpenTelemetry attributes from JFinal's JsonRender to prevent serialization issues
Reviewed Changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| settings.gradle.kts | Adds the new jfinal-3.6:javaagent module to the build |
| TestController.java | Test controller implementing various HTTP endpoints for instrumentation testing |
| TestConfig.java | JFinal configuration class for test setup |
| JFinalTest.java | Integration test suite validating instrumentation behavior |
| JFinalSingletons.java | Core instrumentation logic including instrumenter setup and route extraction |
| JFinalInstrumentationModule.java | Module definition for JFinal instrumentation |
| ActionMappingInstrumentation.java | Instrumentation for ActionMapping.getAction() to extract HTTP routes |
| ActionHandlerInstrumentation.java | Instrumentation for ActionHandler.handle() to create handler spans |
| build.gradle.kts | Build configuration with dependencies and test settings |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
...avaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/jfinal/TestController.java
Outdated
Show resolved
Hide resolved
...ain/java/io/opentelemetry/javaagent/instrumentation/jfinal/ActionMappingInstrumentation.java
Outdated
Show resolved
Hide resolved
...main/java/io/opentelemetry/javaagent/instrumentation/jfinal/JFinalInstrumentationModule.java
Outdated
Show resolved
Hide resolved
...ain/java/io/opentelemetry/javaagent/instrumentation/jfinal/ActionHandlerInstrumentation.java
Outdated
Show resolved
Hide resolved
...t/src/main/java/io/opentelemetry/javaagent/instrumentation/jfinal/v3_6/JFinalSingletons.java
Outdated
Show resolved
Hide resolved
...t/src/main/java/io/opentelemetry/javaagent/instrumentation/jfinal/v3_2/JFinalSingletons.java
Show resolved
Hide resolved
| public static HandleAdvice.AdviceScope onEnter() { | ||
| return HandleAdvice.AdviceScope.start(currentContext()); |
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.
| public static HandleAdvice.AdviceScope onEnter() { | |
| return HandleAdvice.AdviceScope.start(currentContext()); | |
| public static AdviceScope onEnter() { | |
| return AdviceScope.start(currentContext()); |
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.
updated
...ain/java/io/opentelemetry/javaagent/instrumentation/jfinal/ActionHandlerInstrumentation.java
Outdated
Show resolved
Hide resolved
...ain/java/io/opentelemetry/javaagent/instrumentation/jfinal/ActionHandlerInstrumentation.java
Outdated
Show resolved
Hide resolved
...ain/java/io/opentelemetry/javaagent/instrumentation/jfinal/ActionMappingInstrumentation.java
Outdated
Show resolved
Hide resolved
....6/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/jfinal/TestConfig.java
Outdated
Show resolved
Hide resolved
Change-Id: I61c0953cd1de4856ca7f143d0af20755399b9095
…upport-jfinal Change-Id: I89962394646e846de25e3a68dbc76e00f472e29a
|
🔧 The result from spotlessApply was committed to the PR branch. |
|
❌ The result from generateLicenseReport could not be committed to the PR branch, see logs: https://github.com/open-telemetry/opentelemetry-java-instrumentation/actions/runs/19100120039. |
Change-Id: I1c1b28366523e7c7a57665d0c312dc40480b9ef7
…upport-jfinal Change-Id: I49595e0b48a44439e05262aaccd9b340ae4f414a
...ava/io/opentelemetry/javaagent/instrumentation/jfinal/v3_2/ActionHandlerInstrumentation.java
Show resolved
Hide resolved
...ava/io/opentelemetry/javaagent/instrumentation/jfinal/v3_2/ActionHandlerInstrumentation.java
Show resolved
Hide resolved
laurit
left a comment
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.
...ava/io/opentelemetry/javaagent/instrumentation/jfinal/v3_6/ActionHandlerInstrumentation.java
Outdated
Show resolved
Hide resolved
...ava/io/opentelemetry/javaagent/instrumentation/jfinal/v3_6/ActionMappingInstrumentation.java
Outdated
Show resolved
Hide resolved
...java/io/opentelemetry/javaagent/instrumentation/jfinal/v3_2/JFinalInstrumentationModule.java
Show resolved
Hide resolved
...java/io/opentelemetry/javaagent/instrumentation/jfinal/v3_6/JFinalInstrumentationModule.java
Outdated
Show resolved
Hide resolved
...t/src/main/java/io/opentelemetry/javaagent/instrumentation/jfinal/v3_6/JFinalSingletons.java
Outdated
Show resolved
Hide resolved
| // GET /redirect GET /redirect | ||
| // |---jfinal.handle |---jfinal.handle | ||
| // |---controller |---controller | ||
| // |---Response.sendRedirect |---Response.sendRedirect |
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.
in assertResponseSpan you can choose the correct parent span and assert that, or is there something else that needs to be done?
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 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.
@laurit l will resolve this conversation if you don't have any more comment?
....6/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/jfinal/JFinalTest.java
Outdated
Show resolved
Hide resolved
...avaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/jfinal/TestController.java
Outdated
Show resolved
Hide resolved
|
🔧 The result from spotlessApply was committed to the PR branch. |
- Remove unused code in ActionHandlerInstrumentation and ActionMappingInstrumentation - Refactor JFinalSingletons to improve code organization - Update JFinalInstrumentationModule configuration - Enhance test coverage in JFinalTest - Update TestController implementation - Add JFinal support to documentation
4929af5 to
3602e5b
Compare
|
🔧 The result from spotlessApply was committed to the PR branch. |
- Remove unused currentContext import - Change HandleAdvice class to private for better encapsulation - Refactor AdviceScope.start() to call Context.current() internally Change-Id: I69e0de219e8cc80bde3bedbd641a211b45ddd6f2
- Changed minimum supported version from 3.6 to 3.2 to extend compatibility - Renamed instrumentation module from jfinal-3.6 to jfinal-3.2 - Updated all package names from v3_6 to v3_2 - Added classLoader matcher to distinguish between JFinal 3.2 and 3.6+ - Changed HandleAdvice class visibility from private to public - Updated documentation to reflect new version support Change-Id: If3a9bc00c0e0ee59328971f3e9cc0152d7defe67
|
🔧 The result from spotlessApply was committed to the PR branch. |
- Simplified classLoader matcher to only exclude JFinal 3.6+ (TypeConverter class) - Updated instrumenter name from jfinal-3.6 to jfinal-3.2 - Adjusted Java version constraint for tests to only apply when not testing latest deps - Updated comment to clarify JFinal 3.6 Java 9+ compatibility issue Change-Id: Ia4a73a9d5767e048c0dfe3897acd394cf641c6b6
|
🔧 The result from spotlessApply was committed to the PR branch. |

resolved #11465