iPrody / iPrody-Devs-Gr0000000008-inquiry-service

0 stars 2 forks source link

Inquiry Service: Logging & Distributed tracing #66

Closed A-Sakhmina closed 1 month ago

A-Sakhmina commented 1 month ago

Prerequisites Any project must use logging and tracing for tracking a passing request over services.

For distributed tracing we will use Micrometer Tracing. Highly recommended to get through its Glossary.

After adding micrometer to the project it should start adding to log line: trace_id and span_id. These fields are goal. Since they will reflect a unique request id that finally help us do a log correlation.

A good simple example here.

Logging appender must be aligned with tracing properties: trace-id=%mdc{traceId} span-id=%mdc{spanId} %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} -%kvp- %msg%n

Required appenders:

Required loggers:

Motivation When we pass a request through services, then we will be able to track this request from the very beginning till the end among all service it passed. It will help do analysis and error investigation, especially in distributed systems' world.

So that,

A-Sakhmina commented 1 month ago

Changes were commited in PR #68