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

Provide Dapr health check #712

Closed
tomkerkhove opened this issue Jan 15, 2021 · 4 comments · Fixed by #1947
Closed

Provide Dapr health check #712

tomkerkhove opened this issue Jan 15, 2021 · 4 comments · Fixed by #1947
Labels
enhancement New feature or request

Comments

@tomkerkhove
Copy link

What would you like to be added:
Provide Dapr health check to determine if it can talk to the sidecar.

Why is this needed:
To ensure that the integration is setup correctly and that the sidecar is reachable & up.

@dmytrohridin
Copy link
Contributor

I can take it, when the new version with dapr/dotnet-sdk#662 will be released

@tomkerkhove
Copy link
Author

Thanks @dmytrohridin !

@bgelens
Copy link

bgelens commented Oct 22, 2021

I'm using this atm

public class DaprHealthCheck : IHealthCheck
{
  private readonly DaprClient _daprClient;

  public DaprHealthCheck(DaprClient daprClient)
  {
    _daprClient = daprClient ?? throw new System.ArgumentNullException(nameof(daprClient));
  }

  public async Task<HealthCheckResult> CheckHealthAsync(HealthCheckContext context, CancellationToken cancellationToken = default)
  {
    return await _daprClient.CheckHealthAsync(cancellationToken)
      ? new HealthCheckResult(HealthStatus.Healthy, "Dapr Sidecar is healthy")
      : new HealthCheckResult(HealthStatus.Unhealthy, "Dapr Sidecar is unhealthy");
  }
}

@dmytrohridin Are you still planning on contributing? If not, I might take a shot at it

@dmytrohridin
Copy link
Contributor

@bgelens feel free

@bgelens bgelens mentioned this issue Oct 28, 2021
6 tasks
@sungam3r sungam3r added the enhancement New feature or request label Jul 22, 2023
@sungam3r sungam3r linked a pull request Jul 25, 2023 that will close this issue
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
4 participants