Adds the ability to configure things needed by stackdriver

We will eventually need to change the encoder to use their format. Also,
stackdriver does not support shared spans.
This commit is contained in:
Adrian Cole
2018-03-20 16:35:19 +08:00
committed by Adrian Cole
parent ad2b9dd39d
commit 3649852ce9
4 changed files with 24 additions and 4 deletions

View File

@@ -34,6 +34,9 @@ public class SleuthProperties {
/** When true, generate 128-bit trace IDs instead of 64-bit ones. */
private boolean traceId128 = false;
/** True means the tracing system supports sharing a span ID between a client and server. */
private boolean supportsJoin = true;
/**
* List of baggage key names that should be propagated out of process.
* These keys will be prefixed with `baggage` before the actual key.
@@ -70,6 +73,14 @@ public class SleuthProperties {
this.traceId128 = traceId128;
}
public boolean isSupportsJoin() {
return this.supportsJoin;
}
public void setSupportsJoin(boolean supportsJoin) {
this.supportsJoin = supportsJoin;
}
public List<String> getBaggageKeys() {
return this.baggageKeys;
}

View File

@@ -74,6 +74,7 @@ public class TraceAutoConfiguration {
.currentTraceContext(currentTraceContext)
.spanReporter(adjustedReporter(reporter))
.traceId128Bit(sleuthProperties.isTraceId128())
.supportsJoin(sleuthProperties.isSupportsJoin())
.build();
}