2

I have few services written in Node that are using "X-Request-Id" as the header to identify requests. I am now writing services in Java using spring-boot where I can use spring-cloud-sleuth to track traceId and spanId.

However, I would like to continue using the "X-Request-Id" as the request identifier across all of my services. Is there any way to rename the "X-B3-TraceId" header in spring-sleuth so that it sends the same header in HTTP requests and also uses the said header from incoming requests to set the traceId?

Pravesh Jain
  • 4,128
  • 6
  • 28
  • 47

2 Answers2

0

You can propagate extra fields, see the Propagation section of the Spring Cloud Sleuth docs.

Jonatan Ivanov
  • 4,895
  • 2
  • 15
  • 30
  • With propagation I'll have to support multiple headers - the previous one that all my Node services are using as well as the "X-B3-TraceId" that spring sleuth adds. Is there no other way? – Pravesh Jain Dec 18 '20 at 15:28
0
spring:
  sleuth:
    propagation-keys: x-correlation-id