Brought back the 128 bit property setting
This commit is contained in:
@@ -31,6 +31,9 @@ public class SleuthProperties {
|
||||
|
||||
private boolean enabled = true;
|
||||
|
||||
/** When true, generate 128-bit trace IDs instead of 64-bit ones. */
|
||||
private boolean traceId128 = false;
|
||||
|
||||
/**
|
||||
* List of baggage key names that should be propagated out of process.
|
||||
* These keys will be prefixed with `baggage` before the actual key.
|
||||
@@ -59,6 +62,14 @@ public class SleuthProperties {
|
||||
this.enabled = enabled;
|
||||
}
|
||||
|
||||
public boolean isTraceId128() {
|
||||
return this.traceId128;
|
||||
}
|
||||
|
||||
public void setTraceId128(boolean traceId128) {
|
||||
this.traceId128 = traceId128;
|
||||
}
|
||||
|
||||
public List<String> getBaggageKeys() {
|
||||
return this.baggageKeys;
|
||||
}
|
||||
|
||||
@@ -66,13 +66,15 @@ public class TraceAutoConfiguration {
|
||||
Propagation.Factory factory,
|
||||
CurrentTraceContext currentTraceContext,
|
||||
Reporter<zipkin2.Span> reporter,
|
||||
Sampler sampler) {
|
||||
Sampler sampler, SleuthProperties sleuthProperties) {
|
||||
return Tracing.newBuilder()
|
||||
.sampler(sampler)
|
||||
.localServiceName(serviceName)
|
||||
.propagationFactory(factory)
|
||||
.currentTraceContext(currentTraceContext)
|
||||
.spanReporter(adjustedReporter(reporter)).build();
|
||||
.spanReporter(adjustedReporter(reporter))
|
||||
.traceId128Bit(sleuthProperties.isTraceId128())
|
||||
.build();
|
||||
}
|
||||
|
||||
private Reporter<zipkin2.Span> adjustedReporter(Reporter<zipkin2.Span> delegate) {
|
||||
|
||||
Reference in New Issue
Block a user