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

Aspire.Microsoft.Azure.Cosmos & Aspire.Microsoft.EntityFrameworkCore.Cosmos Do Not Configure Health Checks #2571

Open
MarcelMichau opened this issue Feb 11, 2025 · 4 comments
Labels
⌚ Not Triaged Not triaged

Comments

@MarcelMichau
Copy link

Hi

The Aspire.Microsoft.Azure.Cosmos & Aspire.Microsoft.EntityFrameworkCore.Cosmos components do not configure health checks for Cosmos DB, though the docs suggest that they do. Their respective settings classes also do not include the DisableHealthChecks property:

MicrosoftAzureCosmosSettings.cs

EntityFrameworkCoreCosmosSettings.cs

In contrast, the Aspire.Hosting.Azure.CosmosDB package does configure health checks using the AspNetCore.HealthChecks.CosmosDb package.

Just wondering if this is by design or was missed. If this needs to added, I'm happy to take a stab at a PR.

Thanks!

@eerhardt
Copy link
Member

The client integration packages not configuring health checks was a decision made by design in the original implementation.

The hosting integration package configures health checks when you call .RunAsEmulator, so it can tell when the emulator is started and ready to accept connections.

The problem here is that the docs seem to suggest that CosmosDB client integrations have health checks, which they don't. Moving this issue to the docs repo to get the docs fixed.

@eerhardt eerhardt transferred this issue from dotnet/aspire Feb 11, 2025
@dotnetrepoman dotnetrepoman bot added the ⌚ Not Triaged Not triaged label Feb 11, 2025
@eerhardt eerhardt removed their assignment Feb 11, 2025
@MarcelMichau
Copy link
Author

Thanks for sharing that insight @eerhardt - that makes sense.

After reading the discussion in the PR you linked to, my question then is:

Is a custom Cosmos DB health check needed at all? Since it doesn't guarantee that the replicas are in fact healthy, or at worst, it could be detrimental as it might consume RUs unnecessarily.

@eerhardt
Copy link
Member

Is a custom Cosmos DB health check needed at all?

I'm not following. Which custom Cosmos DB health check are you referring to? If it is the one in the Hosting integration you are referring to, that one is needed in order for the AppHost to know when the container is ready to accept connections.

@MarcelMichau
Copy link
Author

My apologies, I was unclear. I was referring to adding a Health Check such as https://github.com/Xabaril/AspNetCore.Diagnostics.HealthChecks/tree/master/src/HealthChecks.CosmosDb outside of the Aspire component in a client app.

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

No branches or pull requests

2 participants