Skip to content

Add metrics for client event loops#1159

Open
n0tl3ss wants to merge 3 commits into
6.0.xfrom
issue-421-client-event-loop-metrics
Open

Add metrics for client event loops#1159
n0tl3ss wants to merge 3 commits into
6.0.xfrom
issue-421-client-event-loop-metrics

Conversation

@n0tl3ss

@n0tl3ss n0tl3ss commented Apr 27, 2026

Copy link
Copy Markdown
Member

Summary

  • instrument Netty task queues created through Micronaut event loop group registry so named event loops selected by HTTP clients expose queue metrics
  • preserve transport bean names for instrumented NIO, epoll, and kqueue factories
  • keep Netty event loop groups out of generic executor metrics wrapping

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 -q
  • git diff --check

Resolves #421

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>
@n0tl3ss n0tl3ss added the type: enhancement New feature or request label Apr 27, 2026
@n0tl3ss n0tl3ss self-assigned this Apr 27, 2026

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.

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 EventLoopGroup implementations 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.

Comment thread src/main/docs/guide/metricsConcepts.adoc
n0tl3ss and others added 2 commits April 27, 2026 17:15
Co-Authored-By: Codex with GPT-5 <codex@openai.com>
Co-Authored-By: Codex with GPT-5 <codex@openai.com>
@sonarqubecloud

Copy link
Copy Markdown

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

Labels

type: enhancement New feature or request

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

Metrics for client event loops

2 participants