Add metrics for client event loops#1159
Open
n0tl3ss wants to merge 3 commits into
Open
Conversation
Use the Netty task queue interceptor to expose queue metrics for configured event loop groups, including groups selected by HTTP clients. Keep transport replacement bean names aligned with Micronaut's transport names and avoid wrapping EventLoopGroup beans with executor metrics. Co-Authored-By: Codex with GPT-5 <codex@openai.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds Netty task-queue metrics support for named event loop groups (including HTTP client-selected loops) while keeping Netty event loops out of generic executor instrumentation.
Changes:
- Updates Netty queue metrics instrumentation to support named event loop groups via a task queue interceptor.
- Preserves transport-specific bean names for instrumented NIO/epoll/kqueue event loop group factories.
- Extends executor metrics binder logic to detect and exclude Netty
EventLoopGroupimplementations from wrapping.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| src/main/docs/guide/metricsConcepts.adoc | Updates documentation wording for Netty metrics and mentions tagging by event loop group name. |
| micrometer-core/src/test/groovy/io/micronaut/configuration/metrics/binder/netty/MicronautNettyQueuesMetricsBinderSpec.groovy | Adds a test asserting queue metrics exist for a configured client event loop group. |
| micrometer-core/src/main/java/io/micronaut/configuration/metrics/binder/netty/InstrumentedNioEventLoopGroupFactory.java | Restores/preserves the NIO factory bean name via @Named. |
| micrometer-core/src/main/java/io/micronaut/configuration/metrics/binder/netty/InstrumentedKQueueEventLoopGroupFactory.java | Updates replacement and bean naming to use KQueueEventLoopGroupFactory.NAME. |
| micrometer-core/src/main/java/io/micronaut/configuration/metrics/binder/netty/InstrumentedEventLoopTaskQueueFactory.java | Reworks metrics storage per group and implements TaskQueueInterceptor to support named groups. |
| micrometer-core/src/main/java/io/micronaut/configuration/metrics/binder/netty/InstrumentedEpollEventLoopGroupFactory.java | Updates replacement and bean naming to use EpollEventLoopGroupFactory.NAME. |
| micrometer-core/src/main/java/io/micronaut/configuration/metrics/binder/executor/ExecutorServiceMetricsBinder.java | Avoids wrapping Netty EventLoopGroup implementations even when not in io.netty.* packages. |
Co-Authored-By: Codex with GPT-5 <codex@openai.com>
Co-Authored-By: Codex with GPT-5 <codex@openai.com>
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Summary
Verification
./gradlew :micronaut-micrometer-core:cleanTest :micronaut-micrometer-core:test --tests io.micronaut.configuration.metrics.binder.executor.ExecutorServiceMetricsBinderSpec --tests io.micronaut.configuration.metrics.binder.netty.MicronautNettyQueuesMetricsBinderSpec -qgit diff --checkResolves #421