-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Monitoring Listener Performance with multiple MeterRegistry beans #2148
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
garyrussell
added a commit
to garyrussell/spring-kafka
that referenced
this issue
Mar 7, 2022
Resolves spring-projects#2148 - use Boot's `AutoConfiguredCompositeMeterRegistry`, if only one - use `@Primary` registry bean
garyrussell
added a commit
to garyrussell/spring-kafka
that referenced
this issue
Mar 7, 2022
Resolves spring-projects#2148 - use Boot's `AutoConfiguredCompositeMeterRegistry`, if only one (tested with a Boot application) - use `@Primary` registry bean
garyrussell
added a commit
to garyrussell/spring-kafka
that referenced
this issue
Mar 7, 2022
Resolves spring-projects#2148 - use Boot's `AutoConfiguredCompositeMeterRegistry`, if only one (tested with a Boot application) - use `@Primary` registry bean **cherry-pick to 2.8.x**
garyrussell
added a commit
to garyrussell/spring-kafka
that referenced
this issue
Mar 7, 2022
Resolves spring-projects#2148 - use Boot's `AutoConfiguredCompositeMeterRegistry`, if only one (tested with a Boot application) - use `@Primary` registry bean **cherry-pick to 2.8.x**
garyrussell
added a commit
to garyrussell/spring-kafka
that referenced
this issue
Mar 7, 2022
Resolves spring-projects#2148 - use Boot's `AutoConfiguredCompositeMeterRegistry`, if only one (tested with a Boot application) - use `@Primary` registry bean **cherry-pick to 2.8.x**
artembilan
pushed a commit
that referenced
this issue
Mar 7, 2022
Resolves #2148 - use Boot's `AutoConfiguredCompositeMeterRegistry`, if only one (tested with a Boot application) - use `@Primary` registry bean * Boot's `AutoConfiguredCompositeMeterRegistry` is marked `@Primary`. **cherry-pick to 2.8.x**
artembilan
pushed a commit
that referenced
this issue
Mar 7, 2022
Resolves #2148 - use Boot's `AutoConfiguredCompositeMeterRegistry`, if only one (tested with a Boot application) - use `@Primary` registry bean * Boot's `AutoConfiguredCompositeMeterRegistry` is marked `@Primary`. **cherry-pick to 2.8.x**
garyrussell
added a commit
to garyrussell/spring-kafka
that referenced
this issue
May 18, 2022
**cherry-pick to 2.9.x, 2.8.x**
artembilan
pushed a commit
that referenced
this issue
May 18, 2022
**cherry-pick to 2.9.x, 2.8.x** # Conflicts: # spring-kafka/src/test/java/org/springframework/kafka/support/micrometer/MicrometerHolderTests.java
artembilan
pushed a commit
that referenced
this issue
May 18, 2022
**cherry-pick to 2.9.x, 2.8.x** # Conflicts: # spring-kafka/src/test/java/org/springframework/kafka/support/micrometer/MicrometerHolderTests.java
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Discussed in #2105
Originally posted by alexanderad February 11, 2022
Hi!
Recently I've been looking for a way to monitor listener specific metrics and found a corresponding section in the docs (Monitoring Listener Performance) saying
This way of collecting listener metrics is particulary useful given that it is able to account for multiple types of listeners (e.g. declared with
@KafkaListener
, or@KafkaHandler
, or being batch listeners, or hidden behind custom factories for consumers, etc); as well as aware of concurrent listeners, and templates.The corresponding implementation to be found in:
spring-kafka/spring-kafka/src/main/java/org/springframework/kafka/support/micrometer/MicrometerHolder.java
Lines 61 to 79 in 7c2178a
The problem I faced is that in case when multiple registries are auto-configured for the application context, e.g. Prometheus + Graphite timers for metrics do not register themselves.This applies to any combination of monitoring systems providing more that one
MeterRegistry.class
bean visible viacontext.getBeansOfType(MeterRegistry.class, ...)
.KafkaMessageListenerContainer
silently rejects to collect these metrics, and it seems there is no approachable way to configure alternative behavior, e.g.:containerProperties
)CompositeMeterRegistry
I'm looking for an advice here. Is there anything obvious I'm missing? Is the only one way reasonable in here would be to patch
spring-kafka
itself to achieve metrics collection for the case of multiple metric registries in use?Thanks!
The text was updated successfully, but these errors were encountered: