Skip to content

Add Vert.x 4 HTTP/2 server spans and metrics - #20922

Closed
trask with Copilot wants to merge 15 commits into
mainfrom
copilot/fix-keycloak-http2-metrics
Closed

trask with Copilot wants to merge 15 commits into
mainfrom
copilot/fix-keycloak-http2-metrics

Conversation

Copilot AI commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Keycloak requests over TLS with HTTP/2 bypass Netty’s HTTP/1.1 server instrumentation, leaving server duration metrics missing. This adds instrumentation for Vert.x 4’s HTTP/2 request lifecycle.

Fixes #8927.

  • Telemetry: Reuses standard HTTP server instrumentation, propagation, and suppression; preserves HTTP/1.1 ownership in Netty.
  • Lifecycle: Isolates concurrent streams and ends telemetry once on terminal response writes or failures, including header-only responses, trailers, resets, and connection closure.
  • Regression coverage: Exercises TLS/ALPN negotiation, duration metrics, server spans, and stream isolation across three Vert.x 4 implementation generations. Documentation distinguishes Vert.x-specific coverage from unsupported generic Netty HTTP/2 traffic.

@opentelemetry-pr-dashboard

Copy link
Copy Markdown

Pull request dashboard status

Waiting on the author · refreshed 2026-10-23 22:43 UTC

Move out of draft to request review.

Status above doesn't look right?
  • Just replied or pushed? Anything around or after the refresh time above may not be picked up yet — give it a few minutes.
  • Anything look wrong? Report it with what you expected; it helps us improve the dashboard.

Copilot AI and others added 3 commits October 23, 2026 23:09
Co-authored-by: trask <218610+trask@users.noreply.github.com>
…nerations

Co-authored-by: trask <218610+trask@users.noreply.github.com>
Co-authored-by: trask <218610+trask@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix missing Java-agent HTTP server metrics for Keycloak on HTTP/2 Add Vert.x 4 HTTP/2 server spans and metrics Oct 23, 2026
Copilot AI requested a review from trask October 23, 2026 23:25
@trask
trask requested a balanced review from Copilot October 23, 2026 23:29

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Unresolved lifecycle and callback-propagation defects can shorten server telemetry and break trace continuity.

3 open issues
What changed in this PR

Adds Javaagent instrumentation for Vert.x 4 HTTP/2 servers, addressing missing server spans and duration metrics for TLS/HTTP/2 requests while leaving HTTP/1.1 instrumentation with Netty.

Changes:

  • Adds request, response, and stream lifecycle instrumentation using shared HTTP telemetry support.
  • Adds TLS/ALPN, concurrent-stream, early-response, and failure tests across three Vert.x 4 implementation generations.
  • Registers the module and updates supported-library documentation, metadata collection, and license scanning.
File Description
settings.gradle.kts Registers the new instrumentation project.
instrumentation/​vertx/​vertx-http-server-4.0/​metadata.yaml Declares HTTP/2 server telemetry support.
instrumentation/​vertx/​vertx-http-server-4.0/​javaagent/​src/​test/​java/​io/​opentelemetry/​javaagent/​instrumentation/​vertx/​httpserver/​v4_0/​VertxHttp2ServerTest.java Tests telemetry, propagation, stream isolation, and completion.
instrumentation/​vertx/​vertx-http-server-4.0/​javaagent/​src/​main/​java/​io/​opentelemetry/​javaagent/​instrumentation/​vertx/​httpserver/​v4_0/​VertxHttpServerState.java Holds request context and completion state.
instrumentation/​vertx/​vertx-http-server-4.0/​javaagent/​src/​main/​java/​io/​opentelemetry/​javaagent/​instrumentation/​vertx/​httpserver/​v4_0/​VertxHttpServerSingletons.java Creates the instrumenter and manages telemetry lifecycle.
instrumentation/​vertx/​vertx-http-server-4.0/​javaagent/​src/​main/​java/​io/​opentelemetry/​javaagent/​instrumentation/​vertx/​httpserver/​v4_0/​VertxHttpServerResponseState.java Links response state to its request.
instrumentation/​vertx/​vertx-http-server-4.0/​javaagent/​src/​main/​java/​io/​opentelemetry/​javaagent/​instrumentation/​vertx/​httpserver/​v4_0/​VertxHttpServerInstrumentationModule.java Registers instrumentation and Vert.x version boundaries.
instrumentation/​vertx/​vertx-http-server-4.0/​javaagent/​src/​main/​java/​io/​opentelemetry/​javaagent/​instrumentation/​vertx/​httpserver/​v4_0/​VertxHttpServerAttributesGetter.java Extracts HTTP and network attributes.
instrumentation/​vertx/​vertx-http-server-4.0/​javaagent/​src/​main/​java/​io/​opentelemetry/​javaagent/​instrumentation/​vertx/​httpserver/​v4_0/​ServerRequestHandler.java Starts telemetry and scopes request handling.
instrumentation/​vertx/​vertx-http-server-4.0/​javaagent/​src/​main/​java/​io/​opentelemetry/​javaagent/​instrumentation/​vertx/​httpserver/​v4_0/​ResponseCompletionHandler.java Handles response completion and callback context.
instrumentation/​vertx/​vertx-http-server-4.0/​javaagent/​src/​main/​java/​io/​opentelemetry/​javaagent/​instrumentation/​vertx/​httpserver/​v4_0/​HttpServerRequestHeaderGetter.java Reads propagation headers.
instrumentation/​vertx/​vertx-http-server-4.0/​javaagent/​src/​main/​java/​io/​opentelemetry/​javaagent/​instrumentation/​vertx/​httpserver/​v4_0/​Http2ServerStreamInstrumentation.java Hooks terminal header writes across implementation versions.
instrumentation/​vertx/​vertx-http-server-4.0/​javaagent/​src/​main/​java/​io/​opentelemetry/​javaagent/​instrumentation/​vertx/​httpserver/​v4_0/​Http2ServerResponseInstrumentation.java Hooks response writes, file sends, exceptions, and resets.
instrumentation/​vertx/​vertx-http-server-4.0/​javaagent/​src/​main/​java/​io/​opentelemetry/​javaagent/​instrumentation/​vertx/​httpserver/​v4_0/​Http2ServerRequestInstrumentation.java Instruments dispatch and inbound lifecycle callbacks.
instrumentation/​vertx/​vertx-http-server-4.0/​javaagent/​build.gradle.kts Configures compatibility checks and versioned test suites.
instrumentation/​netty/​netty-4.1/​metadata.yaml Clarifies Vert.x-specific HTTP/2 coverage.
docs/​supported-libraries.md Lists Vert.x 4 HTTP/2 server support.
.github/​scripts/​instrumentations.sh Adds the module to telemetry metadata collection.
.fossa.yml Adds the module to license scanning.

Review effort: Balanced

Co-authored-by: trask <218610+trask@users.noreply.github.com>
Copilot AI requested a review from trask October 24, 2026 00:14
@trask
trask requested a balanced review from Copilot October 24, 2026 00:16

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Delayed terminal header writes can lose completion state, leaving server spans unfinished and duration metrics unrecorded.

1 open issue
3 resolved since last review

Review effort: Balanced

Copilot AI and others added 2 commits October 24, 2026 00:38
Co-authored-by: trask <218610+trask@users.noreply.github.com>
Co-authored-by: trask <218610+trask@users.noreply.github.com>
Copilot AI requested a review from trask October 24, 2026 00:50
@trask
trask requested a balanced review from Copilot October 24, 2026 00:54

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 Needs a closer look

Version-dependent HTTP/2 lifecycle hooks warrant maintainer review, and a callback context-propagation defect remains unresolved.

No open issues 🎉

1 previously missed issue

In code that hasn't changed since last review

Medium severity Preserve parent context for header-only response.end callbacks

instrumentation/​vertx/​vertx-http-server-4.0/​javaagent/​src/​main/​java/​io/​opentelemetry/​javaagent/​instrumentation/​vertx/​httpserver/​v4_0/​Http2ServerResponseInstrumentation.java:85

[Javaagent] In Vert.x 4.3.7 and 4.5.35, header-only response.end(callback) invokes the original completion callback without passing it through the stream-write wrappers. When called under Context.root(), spans created by that callback therefore lose their server parent. Wrap argument 2 with the saved response context independently of telemetry completion, and add a header-only neutral-context callback regression.

Review effort: Balanced

Co-authored-by: trask <218610+trask@users.noreply.github.com>
Copilot AI requested a review from trask October 24, 2026 04:45
@trask
trask requested a balanced review from Copilot October 24, 2026 04:49

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 Needs a closer look

Cross-version HTTP/2 completion hooks, concurrent stream isolation, and synchronous callback reentrancy warrant final human review.

No open issues 🎉

Review effort: Balanced

Co-authored-by: trask <218610+trask@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 Needs a closer look

Version-specific lifecycle ownership needs human review, and callback registration context remains unresolved.

1 open issue

Review effort: Balanced

Co-authored-by: trask <218610+trask@users.noreply.github.com>
Copilot AI requested a review from trask October 24, 2026 18:20
@trask
trask requested a balanced review from Copilot October 24, 2026 18:21

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 Needs a closer look

Version-specific HTTP/2 lifecycle hooks and asynchronous completion ownership warrant final maintainer review.

No open issues 🎉

1 resolved since last review

Review effort: Balanced

@trask

trask commented Oct 25, 2026

Copy link
Copy Markdown
Member

Closing, too complex to pursue before 3.0 release

@trask trask closed this Oct 25, 2026
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.

HTTP Instrumentation on Quarkus/Netty doesn't work for TLS + HTTP/2

3 participants