latest brave
This commit is contained in:
@@ -33,7 +33,7 @@
|
||||
<maven.compiler.target>1.8</maven.compiler.target>
|
||||
<maven.compiler.source>1.8</maven.compiler.source>
|
||||
<spring-boot.version>2.2.5.RELEASE</spring-boot.version>
|
||||
<brave.version>5.11.1</brave.version>
|
||||
<brave.version>5.11.2</brave.version>
|
||||
<okhttp.version>3.14.6</okhttp.version>
|
||||
</properties>
|
||||
|
||||
|
||||
2
pom.xml
2
pom.xml
@@ -264,7 +264,7 @@
|
||||
<spring-cloud-stream.version>Horsham.SR3</spring-cloud-stream.version>
|
||||
<spring-cloud-netflix.version>2.2.3.BUILD-SNAPSHOT</spring-cloud-netflix.version>
|
||||
<spring-cloud-openfeign.version>2.2.3.BUILD-SNAPSHOT</spring-cloud-openfeign.version>
|
||||
<brave.version>5.11.1</brave.version>
|
||||
<brave.version>5.11.2</brave.version>
|
||||
<spring-security-boot-autoconfigure.version>2.1.7.RELEASE</spring-security-boot-autoconfigure.version>
|
||||
<spring-cloud-aws.version>2.2.1.RELEASE</spring-cloud-aws.version>
|
||||
<disable.nohttp.checks>false</disable.nohttp.checks>
|
||||
|
||||
@@ -22,7 +22,7 @@ import java.util.TreeSet;
|
||||
|
||||
import brave.baggage.BaggageField;
|
||||
import brave.baggage.BaggageFields;
|
||||
import brave.baggage.CorrelationField;
|
||||
import brave.baggage.CorrelationScopeConfig.SingleCorrelationField;
|
||||
import brave.baggage.CorrelationScopeDecorator;
|
||||
import brave.context.slf4j.MDCScopeDecorator;
|
||||
import brave.propagation.CurrentTraceContext.Scope;
|
||||
@@ -47,13 +47,13 @@ final class Slf4jScopeDecorator implements ScopeDecorator {
|
||||
// Backward compatibility for all logging patterns
|
||||
private static final ScopeDecorator LEGACY_IDS = MDCScopeDecorator.newBuilder()
|
||||
.clear()
|
||||
.addField(CorrelationField.newBuilder(BaggageFields.TRACE_ID)
|
||||
.add(SingleCorrelationField.newBuilder(BaggageFields.TRACE_ID)
|
||||
.name("X-B3-TraceId").build())
|
||||
.addField(CorrelationField.newBuilder(BaggageFields.PARENT_ID)
|
||||
.add(SingleCorrelationField.newBuilder(BaggageFields.PARENT_ID)
|
||||
.name("X-B3-ParentSpanId").build())
|
||||
.addField(CorrelationField.newBuilder(BaggageFields.SPAN_ID)
|
||||
.add(SingleCorrelationField.newBuilder(BaggageFields.SPAN_ID)
|
||||
.name("X-B3-SpanId").build())
|
||||
.addField(CorrelationField.newBuilder(BaggageFields.SAMPLED)
|
||||
.add(SingleCorrelationField.newBuilder(BaggageFields.SAMPLED)
|
||||
.name("X-Span-Export").build())
|
||||
.build();
|
||||
|
||||
@@ -63,10 +63,10 @@ final class Slf4jScopeDecorator implements ScopeDecorator {
|
||||
SleuthSlf4jProperties sleuthSlf4jProperties) {
|
||||
|
||||
CorrelationScopeDecorator.Builder builder = MDCScopeDecorator.newBuilder().clear()
|
||||
.addField(CorrelationField.create(BaggageFields.TRACE_ID))
|
||||
.addField(CorrelationField.create(BaggageFields.PARENT_ID))
|
||||
.addField(CorrelationField.create(BaggageFields.SPAN_ID))
|
||||
.addField(CorrelationField.newBuilder(BaggageFields.SAMPLED)
|
||||
.add(SingleCorrelationField.create(BaggageFields.TRACE_ID))
|
||||
.add(SingleCorrelationField.create(BaggageFields.PARENT_ID))
|
||||
.add(SingleCorrelationField.create(BaggageFields.SPAN_ID))
|
||||
.add(SingleCorrelationField.newBuilder(BaggageFields.SAMPLED)
|
||||
.name("spanExportable").build());
|
||||
|
||||
Set<String> whitelist = new TreeSet<>(String.CASE_INSENSITIVE_ORDER);
|
||||
@@ -83,7 +83,7 @@ final class Slf4jScopeDecorator implements ScopeDecorator {
|
||||
// For backwards compatibility set all fields dirty, so that any changes made by
|
||||
// MDC directly are reverted.
|
||||
for (String name : retained) {
|
||||
builder.addField(CorrelationField.newBuilder(BaggageField.create(name))
|
||||
builder.add(SingleCorrelationField.newBuilder(BaggageField.create(name))
|
||||
.dirty().build());
|
||||
}
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ package org.springframework.cloud.sleuth.log;
|
||||
|
||||
import brave.Span;
|
||||
import brave.Tracer;
|
||||
import brave.baggage.CorrelationField;
|
||||
import brave.baggage.CorrelationScopeConfig.SingleCorrelationField;
|
||||
import brave.propagation.CurrentTraceContext.Scope;
|
||||
import brave.propagation.ExtraFieldPropagation;
|
||||
import org.assertj.core.api.InstanceOfAssertFactories;
|
||||
@@ -174,9 +174,10 @@ public class Slf4JSpanLoggerTest {
|
||||
@Test
|
||||
public void should_only_include_whitelist() {
|
||||
assertThat(this.slf4jScopeDecorator).extracting("delegate.fields")
|
||||
.asInstanceOf(InstanceOfAssertFactories.array(CorrelationField[].class))
|
||||
.extracting(CorrelationField::name).containsExactly("traceId", "parentId",
|
||||
"spanId", "spanExportable", "my-baggage", "my-local",
|
||||
.asInstanceOf(
|
||||
InstanceOfAssertFactories.array(SingleCorrelationField[].class))
|
||||
.extracting(SingleCorrelationField::name).containsExactly("traceId",
|
||||
"parentId", "spanId", "spanExportable", "my-baggage", "my-local",
|
||||
"my-propagation"); // my-baggage-two is not in the whitelist
|
||||
}
|
||||
|
||||
|
||||
@@ -31,8 +31,8 @@
|
||||
<name>spring-cloud-sleuth-dependencies</name>
|
||||
<description>Spring Cloud Sleuth Dependencies</description>
|
||||
<properties>
|
||||
<brave.version>5.11.1</brave.version>
|
||||
<brave.opentracing.version>0.36.1</brave.opentracing.version>
|
||||
<brave.version>5.11.2</brave.version>
|
||||
<brave.opentracing.version>0.36.2</brave.opentracing.version>
|
||||
<grpc.spring.boot.version>3.4.1</grpc.spring.boot.version>
|
||||
</properties>
|
||||
<dependencyManagement>
|
||||
|
||||
Reference in New Issue
Block a user