The microservice architecture pattern. Requests often span multiple services. Each service handles a request by performing one or more operations, e.g. database queries, publishes messages, etc.
How to understand the behavior of an application and troubleshoot problems?
The solution is Distributed Tracing and Log Aggregation
Distributed Tracing
Trace ID: A unique ID to trace the path of a request, If the request spans multiple services (Request ID).
Span ID: A unique ID to track requests related to a single service only (Service ID).
Log Aggregation
Storing of logs for visualization and analysis in an external/centralized place. Additional infra and setup costs. How to implement Log Aggregation.
1) Spring Cloud Sleuth + Zepkin
2) OpenTracing + Jaeger
3) ELK (ElasticSearch, Logstash, Kibana)Note:
It is not mandatory to introduce Log Tracing in every Microservice architecture.
It is used for monitoring the behavior of applications and triggering specific alerts based on errors or exceptions. It totally depends on:
1) How you have designed your Architecture of application?
2) The microservices you created are independent in terms of resource processing or not?
No comments:
Post a Comment