You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the issue
I would like to be able to disable the KafkaBinderMetrics bean, which is responsible for periodically monitoring and calculating the spring.cloud.stream.binder.kafka.offset metric.
I believe this happens because, in a multi-binder scenario, the configurations specified in the spring.main.resources property are always loaded after the KafkaBinderConfiguration is initialized.
The motivation for disabling the LAG metrics is that native Kafka metrics already reflect the LAG, and the KafkaBinderMetrics bean creates a scheduler that runs periodically to perform calculations—even when filtering those metrics using an Observability API filter—which consumes system resources.
Describe the issue
I would like to be able to disable the
KafkaBinderMetrics
bean, which is responsible for periodically monitoring and calculating thespring.cloud.stream.binder.kafka.offset
metric.Although this bean is annotated with
@ConditionalOnMissingBean(KafkaBinderMetrics.class)
, in a multi-binder scenario it is not possible to disable it, even when creating a specific configuration for the binder using thespring.main.resources
property, as shown in this example application.I believe this happens because, in a multi-binder scenario, the configurations specified in the
spring.main.resources
property are always loaded after theKafkaBinderConfiguration
is initialized.The motivation for disabling the LAG metrics is that native Kafka metrics already reflect the LAG, and the
KafkaBinderMetrics
bean creates a scheduler that runs periodically to perform calculations—even when filtering those metrics using an Observability API filter—which consumes system resources.To Reproduce
Steps to reproduce the behavior:
spring_cloud_stream_binder_kafka_offset
metrics still appear in the Prometheus endpointVersion of the framework
Expected behavior
The
KafkaBinderMetrics
bean should not be created in a multi-binder scenario.The text was updated successfully, but these errors were encountered: