Skip to content

Support instrumentation for Vert.x web and core 5.x#2920

Merged
sharvath-newrelic merged 5 commits into
mainfrom
add-vertx-web-5.x-support
Jun 8, 2026
Merged

Support instrumentation for Vert.x web and core 5.x#2920
sharvath-newrelic merged 5 commits into
mainfrom
add-vertx-web-5.x-support

Conversation

@sharvath-newrelic

@sharvath-newrelic sharvath-newrelic commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

Overview

Adds vertx-core-5.0.0 and vertx-web-5.0.0 instrumentation modules to support applications running on Vert.x 5. Vert.x 5 introduced breaking API changes across its async and HTTP layers, so new modules were required rather than extending the existing 4.x ones.

While many files were able to be cleanly ported from previous Vert.x instrumentation, a few areas required changes.
Some areas of note:

  • Async token propagation: Listener was replaced by Completable in FutureImpl's internals. The tryComplete/tryFail pair was unified into completeInternal, and a new onComplete(successHandler, failureHandler) weave point wraps both handlers at registration time via CallbackWrapper, to help ensure async continuations run in the correct transaction context whether the future resolves synchronously or later.
  • HTTP client: The PromiseInternal-accepting overload of doRequest was removed in 5.x, replaced with a Future-returning variant with a different signature. The weave point moved to the public request(RequestOptions) method. Attaching the result handler was delegated to a utility method (VertxCoreUtil.attachRequestResultHandler) because calling onComplete directly inside a weave method body triggered an IncompatibleClassChangeError at startup.
  • Blocking execution: executeBlocking changed from Handler<Promise<T>> to Callable<T>. The token wrapper was updated: (PromiseHandlerWrapperCallableWrapper), and the now-removed setResultHandler was dropped.

Related Github Issue

Resolves #2136

Testing

Both modules mirror the test suites of the prior Vert.x instrumentation modules with additions made to support the 5.x API.

@codecov-commenter

codecov-commenter commented Jun 2, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 70.73%. Comparing base (256210b) to head (8c6e372).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #2920      +/-   ##
============================================
- Coverage     70.73%   70.73%   -0.01%     
+ Complexity    10666    10664       -2     
============================================
  Files           879      879              
  Lines         43004    43004              
  Branches       6512     6512              
============================================
- Hits          30419    30418       -1     
+ Misses         9657     9655       -2     
- Partials       2928     2931       +3     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

if (token != null) {
context.data().remove(NEWRELIC_TOKEN);
nameTransaction(context, NewRelic.getAgent().getTransaction());
NewRelic.getAgent().getTransaction().setWebResponse(new VertxHttpServerResponseWrapper(context));

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Ran into issues where the status code attribute was inconsistently being sent and resolved to apply context before expiration.

@sharvath-newrelic
sharvath-newrelic marked this pull request as ready for review June 8, 2026 16:39
@sharvath-newrelic
sharvath-newrelic merged commit ff6fa51 into main Jun 8, 2026
264 of 266 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add support for vertx-core-5.x and vertx-web-5.x

3 participants