Skip to content
This repository has been archived by the owner on Jan 19, 2022. It is now read-only.

Support Extra Propagation Fields with Trace #2290

Merged
merged 8 commits into from
May 19, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@
<maven.compiler.target>1.8</maven.compiler.target>
<spring-cloud-commons.version>2.2.3.BUILD-SNAPSHOT</spring-cloud-commons.version>
<spring-cloud-bus.version>2.2.2.BUILD-SNAPSHOT</spring-cloud-bus.version>
<spring-cloud-sleuth.version>2.2.2.BUILD-SNAPSHOT</spring-cloud-sleuth.version>
<spring-cloud-sleuth.version>2.2.3.BUILD-SNAPSHOT</spring-cloud-sleuth.version>
<spring-cloud-stream.version>Ivyland.BUILD-SNAPSHOT</spring-cloud-stream.version>
<zipkin-gcp.version>0.16.0</zipkin-gcp.version>
<zipkin-gcp.version>0.17.0</zipkin-gcp.version>
<app-engine-maven-plugin.version>1.3.2</app-engine-maven-plugin.version>
<kotlin.version>1.3.31</kotlin.version>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2017-2019 the original author or authors.
* Copyright 2017-2020 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -22,9 +22,11 @@

import javax.annotation.PreDestroy;

import brave.baggage.BaggagePropagation;
import brave.http.HttpClientParser;
import brave.http.HttpServerParser;
import brave.propagation.Propagation;
import brave.propagation.B3Propagation;
import brave.propagation.stackdriver.StackdriverTracePropagation;
import com.google.api.gax.core.CredentialsProvider;
import com.google.api.gax.core.ExecutorProvider;
import com.google.api.gax.core.FixedExecutorProvider;
Expand All @@ -36,7 +38,6 @@
import org.apache.commons.logging.LogFactory;
import zipkin2.CheckResult;
import zipkin2.Span;
import zipkin2.propagation.stackdriver.StackdriverTracePropagation;
import zipkin2.reporter.AsyncReporter;
import zipkin2.reporter.Reporter;
import zipkin2.reporter.ReporterMetrics;
Expand All @@ -58,11 +59,9 @@
import org.springframework.cloud.sleuth.autoconfig.SleuthProperties;
import org.springframework.cloud.sleuth.autoconfig.TraceAutoConfiguration;
import org.springframework.cloud.sleuth.instrument.web.TraceHttpAutoConfiguration;
import org.springframework.cloud.sleuth.sampler.SamplerAutoConfiguration;
import org.springframework.cloud.sleuth.sampler.SamplerProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;
import org.springframework.context.annotation.Primary;
import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler;

Expand All @@ -81,7 +80,6 @@
@ConditionalOnProperty(value = { "spring.sleuth.enabled", "spring.cloud.gcp.trace.enabled" }, matchIfMissing = true)
@ConditionalOnClass(StackdriverSender.class)
@AutoConfigureBefore(TraceAutoConfiguration.class)
@Import(SamplerAutoConfiguration.class)
public class StackdriverTraceAutoConfiguration {

private static final Log LOGGER = LogFactory.getLog(StackdriverTraceAutoConfiguration.class);
Expand Down Expand Up @@ -221,8 +219,9 @@ public Sender stackdriverSender(GcpTraceProperties traceProperties,

@Bean
@ConditionalOnMissingBean
public Propagation.Factory stackdriverPropagation() {
return StackdriverTracePropagation.FACTORY;
public BaggagePropagation.FactoryBuilder baggagePropagationFactoryBuilder() {
return BaggagePropagation.newFactoryBuilder(StackdriverTracePropagation.newFactory(
B3Propagation.newFactoryBuilder().injectFormat(B3Propagation.Format.MULTI).build()));
meltsufin marked this conversation as resolved.
Show resolved Hide resolved
}

@PreDestroy
Expand Down