question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Kafka microservice health check does not work

See original GitHub issue

Is 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:open
  • Created 2 years ago
  • Reactions:4
  • Comments:10 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
jlahtinencommented, Nov 1, 2022

@Tony133 Thank you. Works as you described.

1reaction
jlahtinencommented, Oct 26, 2022

@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).

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found