Java Code Examples for brave.baggage.BaggagePropagation#newFactoryBuilder()

The following examples show how to use brave.baggage.BaggagePropagation#newFactoryBuilder() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: BaggagePropagationFactoryBean.java    From brave with Apache License 2.0 5 votes vote down vote up
@Override public Propagation.Factory getObject() {
  BaggagePropagation.FactoryBuilder builder =
    BaggagePropagation.newFactoryBuilder(propagationFactory);
  if (configs != null) {
    builder.clear();
    for (BaggagePropagationConfig config : configs) {
      builder.add(config);
    }
  }
  if (customizers != null) {
    for (BaggagePropagationCustomizer customizer : customizers) customizer.customize(builder);
  }
  return builder.build();
}
 
Example 2
Source File: StackdriverTraceAutoConfiguration.java    From spring-cloud-gcp with Apache License 2.0 4 votes vote down vote up
@Bean
@ConditionalOnMissingBean
public BaggagePropagation.FactoryBuilder baggagePropagationFactoryBuilder() {
	return BaggagePropagation.newFactoryBuilder(StackdriverTracePropagation.newFactory(
			B3Propagation.newFactoryBuilder().injectFormat(B3Propagation.Format.MULTI).build()));
}
 
Example 3
Source File: WebClientTests.java    From spring-cloud-sleuth with Apache License 2.0 4 votes vote down vote up
@Bean
BaggagePropagation.FactoryBuilder baggagePropagationFactoryBuilder() {
	// Use b3 single format as it is less verbose
	return BaggagePropagation.newFactoryBuilder(B3Propagation.newFactoryBuilder()
			.injectFormat(CLIENT, SINGLE_NO_PARENT).build());
}
 
Example 4
Source File: TraceAutoConfigurationPropagationCustomizationTests.java    From spring-cloud-sleuth with Apache License 2.0 4 votes vote down vote up
@Bean
public BaggagePropagation.FactoryBuilder b3Single() {
	return BaggagePropagation.newFactoryBuilder(B3SinglePropagation.FACTORY);
}
 
Example 5
Source File: TraceAutoConfigurationTests.java    From spring-cloud-sleuth with Apache License 2.0 4 votes vote down vote up
@Bean
BaggagePropagation.FactoryBuilder baggagePropagationFactoryBuilderBean() {
	return BaggagePropagation.newFactoryBuilder(B3SinglePropagation.FACTORY);
}
 
Example 6
Source File: TraceCustomFilterResponseInjectorTests.java    From spring-cloud-sleuth with Apache License 2.0 4 votes vote down vote up
@Bean
BaggagePropagation.FactoryBuilder baggagePropagationFactoryBuilder() {
	// Use b3 single format as it is less verbose
	return BaggagePropagation.newFactoryBuilder(B3Propagation.newFactoryBuilder()
			.injectFormat(CLIENT, SINGLE_NO_PARENT).build());
}
 
Example 7
Source File: ExtraFieldPropagation.java    From brave with Apache License 2.0 4 votes vote down vote up
FactoryBuilder(Propagation.Factory delegate) {
  this.delegate = delegate;
  this.baggageFactory = BaggagePropagation.newFactoryBuilder(delegate);
}
 
Example 8
Source File: TraceBaggageConfiguration.java    From spring-cloud-sleuth with Apache License 2.0 2 votes vote down vote up
/**
 * To override the underlying context format, override this bean and set the delegate
 * to what you need. {@link BaggagePropagation.FactoryBuilder} will unwrap itself if
 * no fields are configured.
 *
 * <p>
 * This will use {@link B3Propagation.Format#SINGLE_NO_PARENT} for non-remote spans,
 * such as for messaging. Note: it will still parse incoming multi-header spans.
 */
@Bean
@ConditionalOnMissingBean
BaggagePropagation.FactoryBuilder baggagePropagationFactoryBuilder() {
	return BaggagePropagation.newFactoryBuilder(B3_FACTORY);
}