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 Object
Configures the 
StackdriverSender for Micronaut if present on the classpath.- Since:
- 1.0
- Author:
- graemerocher, Ray Tsang
- 
Field SummaryFields
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionprotected @NonNull io.micronaut.context.event.BeanCreatedEventListener<io.micronaut.tracing.brave.BraveTracerConfiguration>ABeanCreatedEventListenerthat modifies the brave trace configuration for Stackdriver compatibility.protected brave.propagation.Propagation.FactoryThePropagation.Factoryas a bean.zipkin2.reporter.AsyncReporter<zipkin2.Span>stackdriverReporter(@NonNull io.micronaut.tracing.brave.AsyncReporterConfiguration configuration) A customAsyncReporterthat usesStackdriverEncoder.V2.protected @NonNull zipkin2.reporter.SenderstackdriverSender(@NonNull GoogleCloudConfiguration cloudConfiguration, @NonNull com.google.auth.oauth2.GoogleCredentials credentials, @NonNull io.grpc.ManagedChannel channel) TheStackdriverSenderbean.protected @NonNull io.grpc.ManagedChannel
- 
Field Details- 
TRACE_SCOPEThe trace scope to use.
- 
TRACE_TARGETThe trace target to use.- See Also:
 
- 
PROPERTY_ENABLEDThe property used to enable tracing.- See Also:
 
 
- 
- 
Constructor Details- 
StackdriverSenderFactorypublic StackdriverSenderFactory()
 
- 
- 
Method Details- 
stackdriverTraceSenderChannel@Singleton @Bean(preDestroy="shutdownNow") @Named("stackdriverTraceSenderChannel") @NonNull protected @NonNull 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 @NonNull zipkin2.reporter.Sender stackdriverSender(@NonNull @NonNull GoogleCloudConfiguration cloudConfiguration, @NonNull @NonNull com.google.auth.oauth2.GoogleCredentials credentials, @NonNull @Named("stackdriverTraceSenderChannel") @NonNull io.grpc.ManagedChannel channel) TheStackdriverSenderbean.- Parameters:
- cloudConfiguration- The google cloud configuration
- credentials- The credentials
- channel- The channel to use
- Returns:
- The sender
 
- 
braveTracerConfigurationBeanCreatedEventListener@Singleton @Requires(classes=zipkin2.reporter.stackdriver.StackdriverSender.class) @NonNull protected @NonNull 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 @NonNull io.micronaut.tracing.brave.AsyncReporterConfiguration configuration) A customAsyncReporterthat usesStackdriverEncoder.V2.- Parameters:
- configuration- The configuration
- Returns:
- The bean.
 
 
-