piomin / sample-spring-microservices-new

Demo for Spring Boot 3(`master` branch)/2(other branches) and Spring Cloud microservices with distributed configuration (Spring Cloud Config), service discovery (Eureka), API gateway (Spring Cloud Gateway, Zuul), Swagger/OpenAPI documentation (Springdoc), logs correlation using Spring Cloud Sleuth/Micrometer OTEL and many more
https://piotrminkowski.com
1.17k stars 744 forks source link

Traces are not correctly spanning into multiple services #87

Closed lkamal closed 11 months ago

lkamal commented 11 months ago

In the application, when a request for organization-service is send via the gateway service; the request correctly goes to the organization-service, department-service and employee-service. Also, individual traces are generated. However, those traces are independent hence shown as separate requests.

Following is an example:

organization-service:
            [b2cce3535bb36f51180845d0225fae12,f335828d351f0877] - INFO Organization find: id=1
    department-service: 
            [445a76f99945265f7ed319c24fc6b689,c3bd9f888791aea3] - INFO Department find: organizationId=1
        employee-service: 
            [ff19e04be570e3fd9b08561a2ba7222e,f8af53cf460cd077] - INFO Employee find: departmentId=1
            [89c018ad0dacdc1d9d66828ec722bf40,4cfd6dc63bf109d4] - INFO Employee find: departmentId=2 

I think we need to have these spans linked to one trace-id.