Edition 0 Updated to asp. Net core 0


Health management and diagnostics in microservices



Yüklə 11,82 Mb.
Pdf görüntüsü
səhifə61/288
tarix12.07.2023
ölçüsü11,82 Mb.
#136458
1   ...   57   58   59   60   61   62   63   64   ...   288
NET-Microservices-Architecture-for-Containerized-NET-Applications

Health management and diagnostics in microservices 
It may seem obvious, and it’s often overlooked, but a microservice must report its health and 
diagnostics. Otherwise, there’s little insight 
from an operations perspective. Correlating diagnostic 
events across a set of independent services and dealing with machine clock skews to make sense of 


64 
CHAPTER 3 | Architecting container and microservice-based applications 
the event order is challenging. In the same way that you interact with a microservice over agreed-
upon 
protocols and data formats, there’s a need for standardization in how to log health and 
diagnostic events that ultimately end up in an event store for querying and viewing. In a microservices 
approach, it’s key that different teams agree on a single loggin
g format. There needs to be a 
consistent approach to viewing diagnostic events in the application. 
Health checks 
Health is different from diagnostics. Health is about the microservice reporting its current state to take 
appropriate actions. A good example is working with upgrade and deployment mechanisms to 
maintain availability. Although a service might currently be unhealthy due to a process crash or 
machine reboot, the service might still be operational. The last thing you need is to make this worse 
by performing an upgrade. The best approach is to do an investigation first or allow time for the 
microservice to recover. Health events from a microservice help us make informed decisions and, in 
effect, help create self-healing services. 
In the 
Implementing health checks in ASP.NET Core services
section of this guide, we explain how to 
use a new ASP.NET HealthChecks library in your microservices so they can report their state to a 
monitoring service to take appropriate actions. 
You also have the option of using an excellent open-source library called 
AspNetCore.Diagnostics.HealthChecks, available on 
GitHub
 and as a 
NuGet package
. This library also 
does health checks, with a twist, it handles two types of checks: 


Yüklə 11,82 Mb.

Dostları ilə paylaş:
1   ...   57   58   59   60   61   62   63   64   ...   288




Verilənlər bazası müəlliflik hüququ ilə müdafiə olunur ©azkurs.org 2024
rəhbərliyinə müraciət

gir | qeydiyyatdan keç
    Ana səhifə


yükləyin