Skip to content

feat(micronaut): add Micronaut 4 and 5 support - #70

Merged
antonrh merged 12 commits into
mainfrom
plavreshin/feat-micronaut
Nov 17, 2026
Merged

antonrh merged 12 commits into
mainfrom
plavreshin/feat-micronaut

Conversation

@plavreshin

@plavreshin plavreshin commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

Add automatic request tracing for Micronaut 4.10 and 5 applications.

  • Record matched routes, JDBC statements and transactions, declarative HTTP calls, Logback and request principals.
  • Preserve trace context across Micronaut executors and Reactor thread switches.
  • Enable recording in development environments and serve the existing badge and console.
  • Add separate Micronaut 4 and Java 25/Micronaut 5 checks and include the module in releases.
  • Add the canonical store example in https://github.com/tracepanel/tracepanel-examples/pull/1.
flowchart LR
    Request --> ServerFilter[Micronaut server filter]
    ServerFilter --> Controller
    Controller --> JDBC[Wrapped DataSource]
    Controller --> Client[Declarative HTTP client]
    JDBC --> Trace[Tracepanel trace]
    Client --> Trace
    Trace --> Console[Local console]
Loading

plavreshin and others added 12 commits November 14, 2026 09:13
reactor-core comes with Micronaut's Netty server and HTTP client, of the app's own version: compileOnly. micronaut-reactor is no longer forced on every app (Micronaut 5 runs micronaut-reactor 4.x; a Maven build without the platform BOM got 3.9.1). A reactive app has it already, and it carries the trace across Reactor's threads.
… when it's off

As the Spring and Ktor integrations do: Tracepanel.start gets the packages Micronaut.run(Application.class) names, so its generated classes aren't the app's frames; Log4j 2 records are recorded beside Logback's; outside a dev environment it says once why it's off. The classes say what they are, as the other modules' do.
Micronaut takes the response and cancels the rest of the filter chain: every answered request was recorded failed (status error with a 200). A cancel fails the trace only before its answer. The tests now check the status of an answered request.
Both wrap each DataSource as it is made, in no set order. Over Micronaut Data's contextual proxy, its transaction manager held one connection and the proxy looked for another: a @transactional method failed with NoConnectionException, now and then. The SDK's listener goes first, so it wraps the pool. A suite on Micronaut Data's classpath (testMicronautData) checks a @transactional method: one committed transaction holding its statements.
…app's

$BookController$Definition$Exec sits in the app's package with no line to point at: an error's nearest app frame was it, not the controller's method.
The spans as kind and what each is, the logs, the error's type, message and nearest app frame, and the call's span named as the parent of the trace it reached; explicit imports.
…e them

Install and what it records in the Spring Boot and Ktor sections' shape; no link to a private repository, no word of it being unpublished (the release names its version); the changelog's entry in three lines.
Without a config Logback logs at DEBUG: on Micronaut 5 the HTTP client's own DEBUG record joined the trace's logs. The Micronaut 5 suite reads the same test resources.
@antonrh
antonrh merged commit 0b5941b into main Nov 17, 2026
6 checks passed
@antonrh
antonrh deleted the plavreshin/feat-micronaut branch November 17, 2026 06:29
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.

2 participants