Skip to content
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

Allow registering multiple Kafka health checks. #2298

Open
mitchdenny opened this issue Sep 16, 2024 · 0 comments · May be fixed by #2337
Open

Allow registering multiple Kafka health checks. #2298

mitchdenny opened this issue Sep 16, 2024 · 0 comments · May be fixed by #2337
Assignees
Labels
enhancement New feature or request kafka

Comments

@mitchdenny
Copy link

What would you like to be added:

Currently the AddKafka results in a singleton of the KafkaHealthCheckOptions being registered with DI:

builder.Services.AddSingleton(_ => new KafkaHealthCheck(new KafkaHealthCheckOptions { Configuration = config, Topic = topic }));

This should be adjusted to be more like the other health checks so that multiple health checks can be registered.

Why is this needed:

If you register multiple health checks they all end up having the same options which isn't very useful. I ran into this whilst adding support for Kafka health checks in the .NET Aspire application model and I was scratching my head as to why one of my Kafka health checks wasn't returning healthy - until I figured out it was looking at the write Kafka instance (which wasn't running yet). See:

dotnet/aspire#5719

@Alirexaa Alirexaa added the kafka label Sep 16, 2024
@Alirexaa Alirexaa self-assigned this Sep 16, 2024
@Alirexaa Alirexaa added the enhancement New feature or request label Sep 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request kafka
Projects
None yet
2 participants