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
Absence of metrics and traces in spring-cloud-stream-binder-kafka-reactive #2650
Comments
We are missing the offset lag metric too. Any workarounds available to get at least those basic metrics? |
@kschlesselmann We will take a look at this and see how we can support metrics in the reactive binder. |
reactor-kafka now supports adding Micrometer listeners to instrument the producers and consumers (since 1.3.17). https://projectreactor.io/docs/kafka/release/reference/#_micrometer_metrics |
Indeed, big thanks @garyrussell for the metrics support. |
@garyrussell I enabled reactor kafka metrics like @Configuration(proxyBeanMethods = false)
class ReactorKafkaConfiguration {
@Bean
fun receiverOptionsCustomizer(meterRegistry: MeterRegistry): ReceiverOptionsCustomizer<Any, Any> =
ReceiverOptionsCustomizer { _, receiverOptions ->
receiverOptions.consumerListener(MicrometerConsumerListener(meterRegistry))
}
} and while it seems to work fine there are a lot of metrics/tags now. Any way to reduce those metrics? I tried something like @Bean
fun kafkaMetricsMeterFilter(): MeterFilter = object : MeterFilter {
private val tagsToRemove = setOf(
"client.id",
"reactor-kafka.id",
"kafka.version",
"node.id",
)
override fun map(id: Meter.Id): Meter.Id = if (id.name.startsWith("kafka.")) {
id.tags
.filter { it.key !in tagsToRemove }
.let { id.replaceTags(it) }
} else {
id
}
} but this doesn't seem to work. Any suggestions? |
I would expect a filter to work; if you can't figure it out, I suggest you reach out to the Micrometer folks. We don't support Micrometer internals here. |
Probably the first place to start is debug the |
Hello team, Just checking on this issue. 1 - metrics For item number 1, metrics, I believe this issue is now resolved with the help of this PR: If not anything else, thank you for the help provided. With that said, I believe that as of today, November 2023, traces are yet to be available in spring cloud stream. Thank you for your time. |
Describe the issue
Absence of metrics and traces in spring-cloud-stream-binder-kafka-reactive
To Reproduce
Steps to reproduce the behavior:
Create a simple spring cloud stream reactive kafka producer and consumer
Start producing and consuming messages.
Even with the actuator and micrometer configured, no Kafka related metrics observed.
reactor/reactor-kafka#262
Ditto for traces
version
4.0.2-SNAPSHOT
Expected behavior
Similar to spring-cloud-stream-binder-kafka which supports both metrics and traces, kafka-reactive counterpart does not support any of the two.
Starting an issue here tracking this.
Thank you for the amazing work Spring Cloud Stream team for the reactive support.
Having metrics and traces for spring-cloud-stream-binder-kafka-reactive would allow it to be in production for companies which requires metrics and logs as part of production launch of a business flow based on this framework.
The text was updated successfully, but these errors were encountered: