I have my applications running on GCP cloudrun. One of the services consumes an event on the pubsub topic, and then processes it, and calls another service via the REST end point.
We have used below dependencies which is responsible to handle the trace-id in REST and pubsub call.
implementation("com.google.cloud:spring-cloud-gcp-starter-trace")
implementation("com.google.cloud:spring-cloud-gcp-starter-pubsub")
and below configuration:
spring.cloud.gcp.trace.enabled=true
spring.cloud.gcp.trace.pubsub.enabled=true
But what I can see is different trace-id in log statement of both the services.
Ex: If service 1 which is consuming event from pubsub has trace-id "4b7f76b538f9211acf648dc2049c4add", then service 2 which is getting called by service 1 should have same trace-id, but this is not happening. Service 2 has different trace-id.
Can someone please suggest here what could be the resolution here.
I tried using different versions of dependency spring-cloud-gcp-trace but did not get any result.