Skip to content

Conversation

@pepeshore
Copy link
Contributor

@pepeshore pepeshore commented Nov 4, 2025

resolved #11465

pepeshore and others added 14 commits September 18, 2025 15:27
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
@pepeshore pepeshore requested a review from a team as a code owner November 4, 2025 13:18
@github-actions github-actions bot added the test native This label can be applied to PRs to trigger them to run native tests label Nov 4, 2025
@pepeshore pepeshore changed the title Feat/support jfinal Feat/support jfinal and Fix #11465 Nov 4, 2025
@pepeshore pepeshore changed the title Feat/support jfinal and Fix #11465 Add support for JFinal Nov 4, 2025
@otelbot-java-instrumentation
Copy link
Contributor

🔧 The result from spotlessApply was committed to the PR branch.

@steverao steverao requested a review from Copilot November 5, 2025 02:24
Copy link

Copilot AI left a 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.

Comment on lines 77 to 78
public static HandleAdvice.AdviceScope onEnter() {
return HandleAdvice.AdviceScope.start(currentContext());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
public static HandleAdvice.AdviceScope onEnter() {
return HandleAdvice.AdviceScope.start(currentContext());
public static AdviceScope onEnter() {
return AdviceScope.start(currentContext());

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated

Change-Id: I61c0953cd1de4856ca7f143d0af20755399b9095
…upport-jfinal

Change-Id: I89962394646e846de25e3a68dbc76e00f472e29a
@otelbot-java-instrumentation
Copy link
Contributor

🔧 The result from spotlessApply was committed to the PR branch.

@otelbot-java-instrumentation
Copy link
Contributor

❌ 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
Copy link
Contributor

@laurit laurit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

// GET /redirect GET /redirect
// |---jfinal.handle |---jfinal.handle
// |---controller |---controller
// |---Response.sendRedirect |---Response.sendRedirect
Copy link
Contributor

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As shown below, In assertRespaonseSpan, I can only get span named 'controller' and 'Get /redirect',But span named 'jfinal.handle' is what I needed,I can‘t get this span only if I update the logic in io.opentelemetry.instrumentation.testing.junit.http.AbstractHttpServerTest#assertTheTraces

image

Copy link
Contributor Author

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?

@pepeshore
Copy link
Contributor Author

@otelbot-java-instrumentation
Copy link
Contributor

🔧 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
@otelbot-java-instrumentation
Copy link
Contributor

🔧 The result from spotlessApply was committed to the PR branch.

pepeshore and others added 3 commits November 12, 2025 11:42
- 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
@otelbot-java-instrumentation
Copy link
Contributor

🔧 The result from spotlessApply was committed to the PR branch.

pepeshore and others added 2 commits November 12, 2025 14:21
- 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
@otelbot-java-instrumentation
Copy link
Contributor

🔧 The result from spotlessApply was committed to the PR branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

test native This label can be applied to PRs to trigger them to run native tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Does't compatible with JFinal framework

4 participants