Kafka microservice health check does not work
See original GitHub issueIs there an existing issue for this?
- I have searched the existing issues
Current behavior
Configuring a microservice ping check, like:
this.kafka.pingCheck('KAFKA', {
name: configService.getKafkaClientName(),
transport: Transport.KAFKA,
options: {
client: {
brokers: configService.getKafkaHost(),
},
consumer: {
groupId: configService.getKafkaGroupId(),
},
},
});
The check will alway return “timeout of x
ms exceeded” whatever how many timeout will be set.
But my service still working well with the same Microservice config.
Minimum reproduction code
this.kafka.pingCheck('KAFKA', {
name: configService.getKafkaClientName(),
transport: Transport.KAFKA,
options: {
client: {
brokers: configService.getKafkaHost(),
},
consumer: {
groupId: configService.getKafkaGroupId(),
},
},
});
Steps to reproduce
No response
Expected behavior
Health check should be return UP
status when the kafka is able to connect
Package version
8.0.4
NestJS version
8.2.6
Node.js version
14.17.3
In which operating systems have you tested?
- macOS
- Windows
- Linux
Other
No response
Issue Analytics
- State:
- Created 2 years ago
- Reactions:4
- Comments:10 (4 by maintainers)
Top Results From Across the Web
Monitoring Kafka Applications — Implementing Healthchecks ...
For a Kafka application the health check should purposefully fail in two cases: There is an issue with the communication with Kafka —...
Read more >What's the proper Kubernetes health check for a Kafka ...
Monitoring health information of Kafka Streams applications is not easy. Let's go through a few options and choose the best one for your ......
Read more >Kafka consumers health check in Spring Boot Actuator - Medium
This health check focuses on the state of each consumer, not on the connection to the Kafka broker (although any interruptions will most...
Read more >Health checks for Kafka Streams application on Kubernetes
Although these probes will mitigate problems, there are corner cases you should be aware of while dealing with Kafka Streams app, esp. ones...
Read more >Spring Boot: Kafka health indicator - Stack Overflow
In order to trip health indicator, retrieve data from one of the future objects otherwise indicator is UP even when Kafka is down!!!...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@Tony133 Thank you. Works as you described.
@Tony133 If you have time, please check https://github.com/jlahtinen/nestjskafkaterminus
I think this is about as simple as it can get to reproduce described problem. I have not idea how to fix this.
If
producerOnlyMode: true
is the fix, it should be documented and make clear are the consequences using it (for me all seems to be working with that on localhost, but on k8 all starts to fail again like without producerOnlyMode).