Skip to content

Simplify health check code in .NET Aspire hosting integrations. #6283

@mitchdenny

Description

@mitchdenny

At the moment most hosting integrations are wired up to listen for the ConnectionStringAvailableEvent to capture the connection string and then stuff that value into a captured variable which is shared with the health check registration code. This code is overly cumbersome and we would like to improve it.

The main issue is that typically most of the callbacks to configure clients on the health check registration methods are synchronous which means we can't get the connection string without doing sync over async.

We've filed this issue on the repo containing a lot of the health checks we are using:

Xabaril/AspNetCore.Diagnostics.HealthChecks#2306

That links to this PR which shows an example of the changes we are after applied to Redis:

Xabaril/AspNetCore.Diagnostics.HealthChecks#2305

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-app-modelIssues pertaining to the APIs in Aspire.Hosting, e.g. DistributedApplicationarea-integrationsIssues pertaining to Aspire Integrations packages

    Type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions