health monitoring - Aspire 9.1 Service returns Unhealthy, but Aspire Dashboard does not reflect the state - Stack Overflow

For testing purposes, I changed the code line in the aspire template projectfrom.AddCheck("self&

For testing purposes, I changed the code line in the aspire template project from .AddCheck("self", static () => HealthCheckResult.Healthy(), ["live"]); to .AddCheck("self", static () => HealthCheckResult.Unhealthy(), ["live"]);

I wanted to know how this would reflect on the Dashboard. To my surprise, all Services are flagged green. If I call the /health or /alive URL the service returns Unhealthy as expected. So how can the Dashboard not show this?

The only thing I could see that happened is that if I call /alive, I see an error log at the service mentioning that it is called in an unhealthy state.

For testing purposes, I changed the code line in the aspire template project from .AddCheck("self", static () => HealthCheckResult.Healthy(), ["live"]); to .AddCheck("self", static () => HealthCheckResult.Unhealthy(), ["live"]);

I wanted to know how this would reflect on the Dashboard. To my surprise, all Services are flagged green. If I call the /health or /alive URL the service returns Unhealthy as expected. So how can the Dashboard not show this?

The only thing I could see that happened is that if I call /alive, I see an error log at the service mentioning that it is called in an unhealthy state.

Share Improve this question asked Mar 14 at 11:24 Iaman SwtrseIaman Swtrse 3391 silver badge7 bronze badges 1
  • What do your MapHealthChecks calls look like? – Hans Kilian Commented Mar 21 at 9:34
Add a comment  | 

1 Answer 1

Reset to default 0

Sorry,

I totaly fot about this post because I got my answere by the aspire team directly.

The health check shown in aspire does only concern the pots. However you can add the http health checks easy in the Host project. All you have to do is to Change

IResourceBuilder<ProjectResource> weatherService = builder.AddProject<WeatherService>("weatherservice");

to

IResourceBuilder<ProjectResource> weatherService = builder.AddProject<WeatherService>("weatherservice")
                                                          .WithHttpsHealthCheck("/health");

Now your service will reflect the health state returned by the /health path too.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744659813a4586391.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信