so the problem is when request pass many server and in log explorer,
GCP Cloud Run's trace id and spring cloud gcp's trace id is different like picture below. (in trace:)
(first one is cloud run's log and second one is spring cloud gcp's log)
gcp generate another trace id because it doesn't understand b3 header i think.
My Workaround
so i wrote a code in my common lib like below and it work now, but i think it's not solid code.
@AutoConfiguration(before = {StackdriverTraceAutoConfiguration.class})
@ConditionalOnProperty(prefix = "temp", name = "enabled", havingValue = "true", matchIfMissing = true)
@EnableConfigurationProperties(TracingPropagationProperties.class)
public class TracingPropagationConfig {
@Bean
@ConditionalOnMissingBean(BaggagePropagation.FactoryBuilder.class)
public BaggagePropagation.FactoryBuilder baggagePropagationFactoryBuilder(TracingPropagationProperties properties) {
Propagation.Factory primary = getPropagation(properties.type());
return BaggagePropagation.newFactoryBuilder(StackdriverTracePropagation.newFactory(primary));
}
private Factory getPropagation(PropagationType type) {
return switch (type) {
case W3C -> new W3CPropagation();
case B3 -> B3Propagation.newFactoryBuilder().injectFormat(Format.MULTI).build();
};
}
}
Please understand that my English may be awkward and I may appear rude.
Problem
I use GCP Cloud Run and it only use w3c trace propagation spec only. you can see the documentation about it (link)
and in
com.google.cloud.spring.autoconfigure.trace.StackdriverTraceAutoConfiguration
it use b3 propagation onlyso the problem is when request pass many server and in log explorer,
GCP Cloud Run's trace id and spring cloud gcp's trace id is different like picture below. (in trace:)
(first one is cloud run's log and second one is spring cloud gcp's log)
gcp generate another trace id because it doesn't understand b3 header i think.
My Workaround
so i wrote a code in my common lib like below and it work now, but i think it's not solid code.
Suggestion
Any plan to support w3c propagation?