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

Multiple health checks are not working. #2375

Open
jeyamaal opened this issue Feb 17, 2025 · 0 comments
Open

Multiple health checks are not working. #2375

jeyamaal opened this issue Feb 17, 2025 · 0 comments

Comments

@jeyamaal
Copy link

Multiple health checks are not working:

Initially, multiple health checks are working for 6.0.2 version but it is not working in 8.0.1 version. Please enable multiple health checks since we are using readOnly and readWrite database instances.

Error message:

'Duplicate health checks were registered with the name(s): mysql (Parameter 'registrations')'

Source code:

services.AddHealthChecks()
    .AddCheck("self", () => HealthCheckResult.Healthy())
    .AddMySql(
        readOnlyDbConnectionString, 
        nameof(DataContext), 
        tags: new[] { "services" }
    )
    .AddMySql(
        readWriteDbConnectionString, 
        nameof(ReadOnlyDataContext), 
        tags: new[] { "services" }
    );

Environment:

.NET Core version 8
Healthchecks version 8.0.1
Operative system: Windows

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant