Package io.micronaut.gcp.tracing.zipkin
Class StackdriverSenderFactory
- java.lang.Object
 - 
- io.micronaut.gcp.tracing.zipkin.StackdriverSenderFactory
 
 
- 
@Factory @Requires(classes=zipkin2.reporter.stackdriver.StackdriverSender.class) @Requires(property="gcp.tracing.enabled",value="true",defaultValue="true") public class StackdriverSenderFactory extends java.lang.ObjectConfigures theStackdriverSenderfor Micronaut if present on the classpath.- Since:
 - 1.0
 - Author:
 - graemerocher, Ray Tsang
 
 
- 
- 
Field Summary
Fields Modifier and Type Field Description static java.lang.StringPROPERTY_ENABLEDThe property used to enable tracing.static java.net.URITRACE_SCOPEThe trace scope to use.static java.lang.StringTRACE_TARGETThe trace target to use. 
- 
Constructor Summary
Constructors Constructor Description StackdriverSenderFactory() 
- 
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected io.micronaut.context.event.BeanCreatedEventListener<io.micronaut.tracing.brave.BraveTracerConfiguration>braveTracerConfigurationBeanCreatedEventListener()ABeanCreatedEventListenerthat modifies the brave trace configuration for Stackdriver compatibility.protected brave.propagation.Propagation.FactorystackdriverPropagation()ThePropagation.Factoryas a bean.zipkin2.reporter.AsyncReporter<zipkin2.Span>stackdriverReporter(io.micronaut.tracing.brave.AsyncReporterConfiguration configuration)A customAsyncReporterthat usesStackdriverEncoder.V2.protected zipkin2.reporter.SenderstackdriverSender(GoogleCloudConfiguration cloudConfiguration, com.google.auth.oauth2.GoogleCredentials credentials, io.grpc.ManagedChannel channel)TheStackdriverSenderbean.protected io.grpc.ManagedChannelstackdriverTraceSenderChannel() 
 - 
 
- 
- 
Field Detail
- 
TRACE_SCOPE
public static final java.net.URI TRACE_SCOPE
The trace scope to use. 
- 
TRACE_TARGET
public static final java.lang.String TRACE_TARGET
The trace target to use.- See Also:
 - Constant Field Values
 
 
- 
PROPERTY_ENABLED
public static final java.lang.String PROPERTY_ENABLED
The property used to enable tracing.- See Also:
 - Constant Field Values
 
 
 - 
 
- 
Method Detail
- 
stackdriverTraceSenderChannel
@Singleton @Bean(preDestroy="shutdownNow") @Named("stackdriverTraceSenderChannel") @Nonnull protected io.grpc.ManagedChannel stackdriverTraceSenderChannel()- Returns:
 - A GRPC channel to use to send traces.
 
 
- 
stackdriverSender
@RequiresGoogleProjectId @Requires(classes=zipkin2.reporter.stackdriver.StackdriverSender.class) @Singleton @Nonnull protected zipkin2.reporter.Sender stackdriverSender(@Nonnull GoogleCloudConfiguration cloudConfiguration, @Nonnull com.google.auth.oauth2.GoogleCredentials credentials, @Nonnull @Named("stackdriverTraceSenderChannel") io.grpc.ManagedChannel channel)
TheStackdriverSenderbean.- Parameters:
 cloudConfiguration- The google cloud configurationcredentials- The credentialschannel- The channel to use- Returns:
 - The sender
 
 
- 
braveTracerConfigurationBeanCreatedEventListener
@Singleton @Requires(classes=zipkin2.reporter.stackdriver.StackdriverSender.class) @Nonnull protected io.micronaut.context.event.BeanCreatedEventListener<io.micronaut.tracing.brave.BraveTracerConfiguration> braveTracerConfigurationBeanCreatedEventListener()
ABeanCreatedEventListenerthat modifies the brave trace configuration for Stackdriver compatibility.- Returns:
 - The 
BeanCreatedEventListener 
 
- 
stackdriverPropagation
@Singleton @Requires(beans=zipkin2.reporter.stackdriver.StackdriverSender.class) protected brave.propagation.Propagation.Factory stackdriverPropagation()
ThePropagation.Factoryas a bean.- Returns:
 - The bean.
 
 
- 
stackdriverReporter
@Singleton @Requires(classes=zipkin2.reporter.stackdriver.StackdriverSender.class) @Requires(beans=io.micronaut.tracing.brave.AsyncReporterConfiguration.class) public zipkin2.reporter.AsyncReporter<zipkin2.Span> stackdriverReporter(@Nonnull io.micronaut.tracing.brave.AsyncReporterConfiguration configuration)A customAsyncReporterthat usesStackdriverEncoder.V2.- Parameters:
 configuration- The configuration- Returns:
 - The bean.
 
 
 - 
 
 -