最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

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

programmeradmin3浏览0评论

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.

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论