admin管理员组文章数量:1390204
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 |1 Answer
Reset to default 0Sorry,
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.
本文标签:
版权声明:本文标题:health monitoring - Aspire 9.1 Service returns Unhealthy, but Aspire Dashboard does not reflect the state - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744659813a2618175.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
MapHealthChecks
calls look like? – Hans Kilian Commented Mar 21 at 9:34