├── .editorconfig ├── .gitattributes ├── .github ├── CONTRIBUTING.md ├── ISSUE_TEMPLATE.md ├── ISSUE_TEMPLATE │ ├── bug_report.md │ └── feature_request.md ├── dco.yml └── workflows │ ├── codeql.yaml │ └── maven.yml ├── .gitignore ├── .mvn ├── jvm.config ├── maven.config └── wrapper │ ├── maven-wrapper.jar │ └── maven-wrapper.properties ├── .settings.xml ├── .springformat ├── LICENSE.txt ├── README.adoc ├── asciidoctor.css ├── benchmarks ├── README.adoc ├── pom.xml └── src │ ├── main │ ├── java │ │ └── org │ │ │ └── springframework │ │ │ └── cloud │ │ │ └── sleuth │ │ │ └── benchmarks │ │ │ └── app │ │ │ ├── mvc │ │ │ ├── SleuthBenchmarkingSpringApp.java │ │ │ └── controller │ │ │ │ └── AsyncSimulationController.java │ │ │ ├── stream │ │ │ └── SleuthBenchmarkingStreamApplication.java │ │ │ └── webflux │ │ │ └── SleuthBenchmarkingSpringWebFluxApp.java │ └── resources │ │ └── application.yml │ └── test │ ├── java │ └── org │ │ └── springframework │ │ └── cloud │ │ └── sleuth │ │ └── benchmarks │ │ └── jmh │ │ ├── Pair.java │ │ ├── ProcessLauncherState.java │ │ ├── SampleTests.java │ │ ├── TracerImplementation.java │ │ ├── bridge │ │ └── BridgeTests.java │ │ ├── mvc │ │ ├── AnnotationBenchmarksTests.java │ │ ├── AsyncWithSleuthBenchmarksTests.java │ │ ├── AsyncWithoutSleuthBenchmarksTests.java │ │ ├── HttpFilterBenchmarksTests.java │ │ ├── HttpFilterNoSleuthBenchmarksTests.java │ │ ├── RestTemplateBenchmarkTests.java │ │ └── StartupBenchmarkTests.java │ │ ├── stream │ │ └── MicroBenchmarkStreamTests.java │ │ └── webflux │ │ ├── MicroBenchmarkHttpTests.java │ │ ├── SpringWebFluxBenchmarksTests.java │ │ ├── WithOutReactorSleuthSpringWebFluxBenchmarksTests.java │ │ └── WithOutSleuthSpringWebFluxBenchmarksTests.java │ └── jmeter │ ├── AsyncHttpBenchmarks.jmx │ ├── AsyncMethodBenchmarks.jmx │ ├── SyncHttpBenchmarks.jmx │ └── jmeter.properties ├── docs ├── .asciidoctorconfig.adoc ├── pom.xml └── src │ ├── main │ ├── asciidoc │ │ ├── README.adoc │ │ ├── _attributes.adoc │ │ ├── _configprops.adoc │ │ ├── _spans.adoc │ │ ├── appendix.adoc │ │ ├── documentation-overview.adoc │ │ ├── getting-started.adoc │ │ ├── howto.adoc │ │ ├── images │ │ │ ├── .gitkeep │ │ │ ├── kibana.png │ │ │ ├── parents.jpg │ │ │ ├── trace-id.jpg │ │ │ ├── zipkin-dependencies.png │ │ │ ├── zipkin-error-trace-screenshot.png │ │ │ ├── zipkin-error-trace.png │ │ │ ├── zipkin-error-traces.png │ │ │ └── zipkin-trace-screenshot.png │ │ ├── index.adoc │ │ ├── integrations.adoc │ │ ├── legal.adoc │ │ ├── logback-spring.xml │ │ ├── project-features.adoc │ │ ├── sagan-boot.adoc │ │ ├── sagan-index.adoc │ │ ├── spring-cloud-sleuth.adoc │ │ ├── spring-cloud-sleuth.htmlsingleadoc │ │ ├── spring-cloud-sleuth.pdfadoc │ │ └── using.adoc │ └── java │ │ └── org │ │ └── springframework │ │ └── cloud │ │ └── sleuth │ │ └── documentation │ │ ├── DocsFromSources.java │ │ ├── KeyValueEntry.java │ │ ├── SpanEntry.java │ │ └── SpanSearchingFileVisitor.java │ └── test │ └── java │ └── org │ └── springframework │ └── cloud │ └── sleuth │ └── documentation │ ├── DocsFromSourcesTests.java │ ├── SleuthAnnotationSpan.java │ └── SleuthAsyncSpan.java ├── mvnw ├── mvnw.cmd ├── pom.xml ├── scripts ├── runAcceptanceTests.sh ├── runAcceptanceTestsOfDocApps.sh ├── runJmeterBenchmarks.sh └── runJmhBenchmarks.sh ├── spring-cloud-sleuth-api ├── pom.xml └── src │ ├── main │ └── java │ │ └── org │ │ └── springframework │ │ └── cloud │ │ └── sleuth │ │ ├── BaggageInScope.java │ │ ├── BaggageManager.java │ │ ├── CurrentTraceContext.java │ │ ├── SamplerFunction.java │ │ ├── ScopedSpan.java │ │ ├── Span.java │ │ ├── SpanAndScope.java │ │ ├── SpanCustomizer.java │ │ ├── SpanName.java │ │ ├── SpanNamer.java │ │ ├── Taggable.java │ │ ├── ThreadLocalSpan.java │ │ ├── TraceContext.java │ │ ├── Tracer.java │ │ ├── annotation │ │ ├── ContinueSpan.java │ │ ├── NewSpan.java │ │ ├── NewSpanParser.java │ │ ├── NoOpTagValueResolver.java │ │ ├── SleuthMethodInvocationProcessor.java │ │ ├── SpanTag.java │ │ ├── TagValueExpressionResolver.java │ │ └── TagValueResolver.java │ │ ├── docs │ │ ├── AssertingSpan.java │ │ ├── AssertingSpanBuilder.java │ │ ├── AssertingSpanCustomizer.java │ │ ├── DocumentedSpan.java │ │ ├── DocumentedSpanAssertions.java │ │ ├── EventValue.java │ │ ├── ImmutableAssertingSpan.java │ │ ├── ImmutableAssertingSpanBuilder.java │ │ ├── ImmutableAssertingSpanCustomizer.java │ │ └── TagKey.java │ │ ├── exporter │ │ ├── FinishedSpan.java │ │ ├── SpanFilter.java │ │ ├── SpanIgnoringSpanFilter.java │ │ └── SpanReporter.java │ │ ├── http │ │ ├── HttpClientHandler.java │ │ ├── HttpClientRequest.java │ │ ├── HttpClientResponse.java │ │ ├── HttpRequest.java │ │ ├── HttpRequestParser.java │ │ ├── HttpResponse.java │ │ ├── HttpResponseParser.java │ │ ├── HttpServerHandler.java │ │ ├── HttpServerRequest.java │ │ ├── HttpServerResponse.java │ │ ├── Request.java │ │ └── Response.java │ │ └── propagation │ │ └── Propagator.java │ └── test │ ├── java │ └── org │ │ └── springframework │ │ └── cloud │ │ └── sleuth │ │ ├── ArchitectureTests.java │ │ ├── ThreadLocalSpanTests.java │ │ ├── annotation │ │ └── NoOpTagValueResolverTests.java │ │ ├── docs │ │ └── DocumentedSpanAssertionsTests.java │ │ └── exporter │ │ └── SpanIgnoringSpanFilterTests.java │ └── resources │ ├── META-INF │ └── spring.factories │ ├── application.yml │ └── logback.xml ├── spring-cloud-sleuth-autoconfigure ├── pom.xml └── src │ ├── main │ ├── java │ │ └── org │ │ │ └── springframework │ │ │ └── cloud │ │ │ └── sleuth │ │ │ └── autoconfig │ │ │ ├── SingleSkipPattern.java │ │ │ ├── SleuthAnnotationConfiguration.java │ │ │ ├── SleuthBaggageProperties.java │ │ │ ├── SleuthOpentracingProperties.java │ │ │ ├── SleuthSpanFilterProperties.java │ │ │ ├── SleuthTracerProperties.java │ │ │ ├── TraceConfiguration.java │ │ │ ├── TraceEnvironmentPostProcessor.java │ │ │ ├── actuate │ │ │ ├── BraveFinishedSpanWriter.java │ │ │ ├── BufferingSpanReporter.java │ │ │ ├── FinishedSpanWriter.java │ │ │ ├── SleuthActuatorProperties.java │ │ │ ├── TextOutputFormat.java │ │ │ ├── TraceSleuthActuatorAutoConfiguration.java │ │ │ └── TracesScrapeEndpoint.java │ │ │ ├── brave │ │ │ ├── BraveAutoConfiguration.java │ │ │ ├── BraveBaggageConfiguration.java │ │ │ ├── BraveBridgeConfiguration.java │ │ │ ├── BraveSamplerConfiguration.java │ │ │ ├── ConditionalOnBraveEnabled.java │ │ │ ├── SamplerCondition.java │ │ │ ├── SamplerProperties.java │ │ │ ├── SleuthPropagationProperties.java │ │ │ ├── SleuthProperties.java │ │ │ └── instrument │ │ │ │ ├── grpc │ │ │ │ └── BraveGrpcAutoConfiguration.java │ │ │ │ ├── messaging │ │ │ │ ├── BraveKafkaStreamsAutoConfiguration.java │ │ │ │ └── BraveMessagingAutoConfiguration.java │ │ │ │ ├── mongodb │ │ │ │ └── BraveMongoDbAutoConfiguration.java │ │ │ │ ├── opentracing │ │ │ │ └── BraveOpentracingAutoConfiguration.java │ │ │ │ ├── reactor │ │ │ │ └── netty │ │ │ │ │ └── BraveReactorNettyAutoConfiguration.java │ │ │ │ ├── redis │ │ │ │ ├── BraveRedisAutoConfiguration.java │ │ │ │ └── TraceRedisProperties.java │ │ │ │ ├── rpc │ │ │ │ └── BraveRpcAutoConfiguration.java │ │ │ │ └── web │ │ │ │ ├── BraveHttpBridgeConfiguration.java │ │ │ │ ├── BraveHttpConfiguration.java │ │ │ │ └── client │ │ │ │ └── BraveWebClientAutoConfiguration.java │ │ │ ├── instrument │ │ │ ├── async │ │ │ │ ├── ExecutorBeanPostProcessor.java │ │ │ │ ├── SleuthAsyncProperties.java │ │ │ │ ├── TraceAsyncAutoConfiguration.java │ │ │ │ ├── TraceAsyncCustomAutoConfiguration.java │ │ │ │ └── TraceAsyncDefaultAutoConfiguration.java │ │ │ ├── batch │ │ │ │ ├── TraceBatchAutoConfiguration.java │ │ │ │ ├── TraceJobBuilderFactoryBeanPostProcessor.java │ │ │ │ └── TraceStepBuilderFactoryBeanPostProcessor.java │ │ │ ├── cassandra │ │ │ │ ├── TraceCassandraAutoConfiguration.java │ │ │ │ ├── TraceCassandraReactiveAutoConfiguration.java │ │ │ │ ├── TraceCqlSessionBeanPostProcessor.java │ │ │ │ └── TraceReactiveSessionBeanPostProcessor.java │ │ │ ├── circuitbreaker │ │ │ │ ├── SleuthCircuitBreakerProperties.java │ │ │ │ └── TraceCircuitBreakerAutoConfiguration.java │ │ │ ├── config │ │ │ │ └── TraceSpringCloudConfigAutoConfiguration.java │ │ │ ├── deployer │ │ │ │ ├── TraceAppDeployerBeanPostProcessor.java │ │ │ │ └── TraceDeployerAutoConfiguration.java │ │ │ ├── jdbc │ │ │ │ ├── DataSourceProxyConfiguration.java │ │ │ │ ├── P6SpyConfiguration.java │ │ │ │ ├── P6SpyPropertiesSetter.java │ │ │ │ ├── TraceDataSourceDecoratorBeanPostProcessor.java │ │ │ │ ├── TraceJdbcAutoConfiguration.java │ │ │ │ └── TraceJdbcProperties.java │ │ │ ├── kafka │ │ │ │ ├── SpringKafkaAutoConfiguration.java │ │ │ │ ├── SpringKafkaConsumerPostProcessor.java │ │ │ │ ├── SpringKafkaFactoryBeanPostProcessor.java │ │ │ │ ├── SpringKafkaProducerPostProcessor.java │ │ │ │ ├── TracingKafkaAutoConfiguration.java │ │ │ │ ├── TracingKafkaConsumerBeanPostProcessor.java │ │ │ │ ├── TracingKafkaProducerBeanPostProcessor.java │ │ │ │ ├── TracingKafkaReceiverBeanPostProcessor.java │ │ │ │ └── TracingReactorKafkaAutoConfiguration.java │ │ │ ├── messaging │ │ │ │ ├── SleuthIntegrationMessagingProperties.java │ │ │ │ ├── SleuthMessagingProperties.java │ │ │ │ ├── TraceFunctionAutoConfiguration.java │ │ │ │ ├── TraceSpringIntegrationAutoConfiguration.java │ │ │ │ ├── TraceSpringMessagingAutoConfiguration.java │ │ │ │ └── TraceWebSocketAutoConfiguration.java │ │ │ ├── mongodb │ │ │ │ └── TraceMongoDbAutoConfiguration.java │ │ │ ├── prometheus │ │ │ │ └── PrometheusExemplarsAutoConfiguration.java │ │ │ ├── quartz │ │ │ │ └── TraceQuartzAutoConfiguration.java │ │ │ ├── r2dbc │ │ │ │ ├── TraceConnectionFactoryBeanPostProcessor.java │ │ │ │ ├── TraceProxyConnectionFactoryWrapper.java │ │ │ │ └── TraceR2dbcAutoConfiguration.java │ │ │ ├── reactor │ │ │ │ ├── SleuthReactorProperties.java │ │ │ │ ├── TraceReactorAutoConfiguration.java │ │ │ │ └── TraceReactorAutoConfigurationAccessorConfiguration.java │ │ │ ├── redis │ │ │ │ ├── TraceLettuceClientResourcesBeanPostProcessor.java │ │ │ │ └── TraceRedisAutoConfiguration.java │ │ │ ├── rsocket │ │ │ │ ├── SleuthRSocketProperties.java │ │ │ │ └── TraceRSocketAutoConfiguration.java │ │ │ ├── rxjava │ │ │ │ ├── SleuthRxJavaSchedulersProperties.java │ │ │ │ └── TraceRxJavaAutoConfiguration.java │ │ │ ├── scheduling │ │ │ │ ├── SleuthSchedulingProperties.java │ │ │ │ └── TraceSchedulingAutoConfiguration.java │ │ │ ├── security │ │ │ │ └── TraceSecurityAutoConfiguration.java │ │ │ ├── session │ │ │ │ └── TraceSessionAutoConfiguration.java │ │ │ ├── task │ │ │ │ ├── TraceApplicationRunnerBeanPostProcessor.java │ │ │ │ ├── TraceCommandLineRunnerBeanPostProcessor.java │ │ │ │ └── TraceTaskAutoConfiguration.java │ │ │ ├── tx │ │ │ │ ├── AbstractTransactionManagerInstrumenter.java │ │ │ │ ├── PlatformTransactionManagerInstrumenter.java │ │ │ │ ├── ReactiveTransactionManagerInstrumenter.java │ │ │ │ ├── TraceKafkaPlatformTransactionManagerBeanPostProcessor.java │ │ │ │ ├── TracePlatformTransactionManagerBeanPostProcessor.java │ │ │ │ ├── TraceReactiveTransactionManagerBeanPostProcessor.java │ │ │ │ └── TraceTxAutoConfiguration.java │ │ │ └── web │ │ │ │ ├── ConditionalOnSleuthHttp.java │ │ │ │ ├── ConditionalOnSleuthWeb.java │ │ │ │ ├── SkipPatternConfiguration.java │ │ │ │ ├── SleuthHttpProperties.java │ │ │ │ ├── SleuthWebProperties.java │ │ │ │ ├── TraceHandlerFunctionAdapterBeanPostProcessor.java │ │ │ │ ├── TraceWebAutoConfiguration.java │ │ │ │ ├── TraceWebFluxConfiguration.java │ │ │ │ ├── TraceWebMvcConfigurer.java │ │ │ │ ├── TraceWebServletConfiguration.java │ │ │ │ └── client │ │ │ │ ├── ConditionalnOnSleuthWebClient.java │ │ │ │ ├── TraceGatewayEnvironmentPostProcessor.java │ │ │ │ ├── TraceWebAsyncClientAutoConfiguration.java │ │ │ │ ├── TraceWebClientAutoConfiguration.java │ │ │ │ └── feign │ │ │ │ ├── SleuthFeignProperties.java │ │ │ │ └── TraceFeignClientAutoConfiguration.java │ │ │ └── zipkin2 │ │ │ ├── ZipkinActiveMqSenderConfiguration.java │ │ │ ├── ZipkinAutoConfiguration.java │ │ │ ├── ZipkinBraveConfiguration.java │ │ │ ├── ZipkinHttpSenderConfiguration.java │ │ │ ├── ZipkinKafkaSenderConfiguration.java │ │ │ ├── ZipkinRabbitSenderConfiguration.java │ │ │ ├── ZipkinSenderCondition.java │ │ │ ├── ZipkinSenderConfigurationImportSelector.java │ │ │ └── ZipkinSenderProperties.java │ └── resources │ │ └── META-INF │ │ ├── additional-spring-configuration-metadata.json │ │ └── spring.factories │ └── test │ ├── java │ └── org │ │ └── springframework │ │ └── cloud │ │ └── sleuth │ │ ├── DisableSecurity.java │ │ ├── DisableWebFluxSecurity.java │ │ ├── PermitAllServletConfiguration.java │ │ ├── PermitAllWebFluxSecurityConfiguration.java │ │ ├── SleuthTestAutoConfiguration.java │ │ └── autoconfig │ │ ├── NoOpBaggageInScope.java │ │ ├── NoOpCurrentTraceContext.java │ │ ├── NoOpHttpClientHandler.java │ │ ├── NoOpHttpServerHandler.java │ │ ├── NoOpPropagator.java │ │ ├── NoOpScopedSpan.java │ │ ├── NoOpSpan.java │ │ ├── NoOpSpanBuilder.java │ │ ├── NoOpSpanCustomizer.java │ │ ├── NoOpSpanInScope.java │ │ ├── NoOpTraceContext.java │ │ ├── NoOpTraceContextBuilder.java │ │ ├── NoOpTracer.java │ │ ├── SleuthNewSpanParserAnnotationDisableTests.java │ │ ├── SleuthNewSpanParserAnnotationNoSleuthTests.java │ │ ├── SpanIgnoringSpanFilterTests.java │ │ ├── TraceEnvironmentPostProcessorTests.java │ │ ├── TraceNoOpAutoConfiguration.java │ │ ├── actuate │ │ ├── BraveFinishedSpanWriterTests.java │ │ ├── BufferingSpanReporterTests.java │ │ ├── TraceSleuthActuatorAutoConfigurationTests.java │ │ └── TracesScrapeEndpointTests.java │ │ ├── brave │ │ ├── BraveAutoConfigurationCustomizersTests.java │ │ ├── BraveAutoConfigurationPropagationCustomizationTests.java │ │ ├── BraveAutoConfigurationTests.java │ │ ├── BraveAutoConfigurationWithDisabledSleuthTests.java │ │ ├── BravePropagationTests.java │ │ ├── BraveSamplerConfigurationTests.java │ │ ├── SpanHandlerTests.java │ │ ├── TraceBaggageEntryConfigurationTests.java │ │ ├── baggage │ │ │ ├── CompositePropagationFactoryTests.java │ │ │ ├── CorrelationScopeDecoratorTest.java │ │ │ └── CustomPropagationFactoryTests.java │ │ └── instrument │ │ │ ├── messaging │ │ │ ├── BraveKafkaStreamsAutoConfigurationIntegrationTests.java │ │ │ └── BraveMessagingAutoConfigurationIntegrationTests.java │ │ │ ├── mongodb │ │ │ ├── BraveMongoDbAutoConfigurationAsyncDriverTest.java │ │ │ └── BraveMongoDbAutoConfigurationTests.java │ │ │ ├── opentracing │ │ │ └── OpenTracingTest.java │ │ │ ├── reactor │ │ │ └── netty │ │ │ │ └── BraveReactorNettyAutoConfigurationTests.java │ │ │ ├── rpc │ │ │ └── BraveRpcAutoConfigurationIntegrationTests.java │ │ │ └── web │ │ │ ├── BraveHttpConfigurationTests.java │ │ │ ├── EndpointWithCyclicDependenciesTests.java │ │ │ └── client │ │ │ └── WebClientTests.java │ │ ├── instrument │ │ ├── async │ │ │ ├── TraceAsyncCustomAutoConfigurationTest.java │ │ │ └── TraceAsyncDefaultAutoConfigurationTests.java │ │ ├── cassandra │ │ │ ├── TraceCassandraAutoConfigurationTests.java │ │ │ └── TraceCassandraReactiveAutoConfigurationTests.java │ │ ├── config │ │ │ └── TraceSpringCloudConfigAutoConfigurationTests.java │ │ ├── jdbc │ │ │ ├── DataSourceDecoratorAutoConfigurationTests.java │ │ │ ├── P6SpyConfigurationTests.java │ │ │ ├── ProxyDataSourceConfigurationTests.java │ │ │ ├── SleuthP6SpyListenerAutoConfigurationTests.java │ │ │ └── SleuthProxyDataSourceListenerAutoConfigurationTests.java │ │ ├── kafka │ │ │ ├── SpringKafkaAutoConfigurationTests.java │ │ │ ├── TraceKafkaAutoConfigurationTests.java │ │ │ └── TraceReactorKafkaAutoConfigurationTests.java │ │ ├── messaging │ │ │ ├── TraceSpringIntegrationAutoConfigurationTests.java │ │ │ └── TraceWebSocketAutoConfigurationTests.java │ │ ├── mongodb │ │ │ └── TraceMongoDbAutoConfigurationTests.java │ │ ├── prometheus │ │ │ └── PrometheusExemplarsAutoConfigurationTests.java │ │ ├── quartz │ │ │ └── TraceQuartzAutoConfigurationTest.java │ │ ├── r2dbc │ │ │ ├── TraceConnectionFactoryBeanPostProcessorTests.java │ │ │ └── TraceR2dbcAutoConfigurationTests.java │ │ ├── scheduling │ │ │ └── TraceSchedulingAutoConfigurationTest.java │ │ ├── session │ │ │ └── TraceSessionAutoConfigurationTests.java │ │ ├── tx │ │ │ ├── PlatformTransactionManagerInstrumenterTests.java │ │ │ ├── TraceTxAutoConfigurationAspectsTests.java │ │ │ └── TraceTxAutoConfigurationTests.java │ │ └── web │ │ │ ├── SkipPatternConfigurationTests.java │ │ │ ├── SkipPatternProviderConfigTest.java │ │ │ ├── TraceTomcatConfigurationTests.java │ │ │ ├── TraceWebServletConfigurationTests.java │ │ │ └── client │ │ │ ├── BraveWebClientAutoConfigurationTests.java │ │ │ ├── GH846Tests.java │ │ │ ├── GatewayAutoConfigurationTests.java │ │ │ ├── TraceVaultConfigurationTests.java │ │ │ ├── TraceWebClientDisabledTests.java │ │ │ └── feign │ │ │ └── TraceNoWebEnvironmentTests.java │ │ └── zipkin2 │ │ ├── ZipkinAutoConfigurationTests.java │ │ ├── ZipkinHttpSenderConfigurationReactiveTests.java │ │ ├── ZipkinHttpSenderConfigurationTests.java │ │ ├── ZipkinSamplerTests.java │ │ └── ZipkinWithDisabledSleuthTests.java │ └── resources │ ├── META-INF │ └── spring.factories │ ├── application-baggage.yml │ ├── application-disabled.yml │ ├── application.yml │ └── logback.xml ├── spring-cloud-sleuth-brave ├── pom.xml └── src │ ├── main │ └── java │ │ └── org │ │ └── springframework │ │ ├── cloud │ │ └── sleuth │ │ │ └── brave │ │ │ ├── LocalServiceName.java │ │ │ ├── bridge │ │ │ ├── BraveBaggageInScope.java │ │ │ ├── BraveBaggageManager.java │ │ │ ├── BraveContextWrappingFunction.java │ │ │ ├── BraveCurrentTraceContext.java │ │ │ ├── BraveFinishedSpan.java │ │ │ ├── BraveHttpClientHandler.java │ │ │ ├── BraveHttpClientRequest.java │ │ │ ├── BraveHttpClientResponse.java │ │ │ ├── BraveHttpRequest.java │ │ │ ├── BraveHttpRequestParser.java │ │ │ ├── BraveHttpResponse.java │ │ │ ├── BraveHttpResponseParser.java │ │ │ ├── BraveHttpServerHandler.java │ │ │ ├── BraveHttpServerRequest.java │ │ │ ├── BraveHttpServerResponse.java │ │ │ ├── BravePropagator.java │ │ │ ├── BraveSamplerFunction.java │ │ │ ├── BraveScopedSpan.java │ │ │ ├── BraveSpan.java │ │ │ ├── BraveSpanBuilder.java │ │ │ ├── BraveSpanCustomizer.java │ │ │ ├── BraveTraceContext.java │ │ │ ├── BraveTraceContextBuilder.java │ │ │ ├── BraveTracer.java │ │ │ ├── CompositePropagationFactorySupplier.java │ │ │ ├── CompositeSpanHandler.java │ │ │ └── W3CPropagation.java │ │ │ ├── instrument │ │ │ ├── grpc │ │ │ │ ├── GrpcManagedChannelBuilderCustomizer.java │ │ │ │ ├── SpringAwareManagedChannelBuilder.java │ │ │ │ └── TracingManagedChannelBuilderCustomizer.java │ │ │ ├── messaging │ │ │ │ ├── ConditionalOnMessagingEnabled.java │ │ │ │ ├── ConsumerSampler.java │ │ │ │ ├── KafkaFactoryBeanPostProcessor.java │ │ │ │ ├── MessageListenerMethodInterceptor.java │ │ │ │ ├── ProducerSampler.java │ │ │ │ ├── SleuthKafkaAspect.java │ │ │ │ ├── SleuthRabbitBeanPostProcessor.java │ │ │ │ ├── TraceConsumerPostProcessor.java │ │ │ │ ├── TraceProducerPostProcessor.java │ │ │ │ ├── TracingConnectionFactoryBeanPostProcessor.java │ │ │ │ └── TracingJmsBeanPostProcessor.java │ │ │ ├── mongodb │ │ │ │ └── TraceMongoClientSettingsBuilderCustomizer.java │ │ │ ├── reactor │ │ │ │ └── netty │ │ │ │ │ ├── TracingChannelInboundHandler.java │ │ │ │ │ ├── TracingChannelOutboundHandler.java │ │ │ │ │ └── TracingHandlerUtil.java │ │ │ ├── redis │ │ │ │ ├── ClientResourcesBuilderCustomizer.java │ │ │ │ └── TraceLettuceClientResourcesBuilderCustomizer.java │ │ │ ├── rpc │ │ │ │ ├── RpcClientSampler.java │ │ │ │ └── RpcServerSampler.java │ │ │ └── web │ │ │ │ ├── BraveSpanFromContextRetriever.java │ │ │ │ ├── CompositeHttpSampler.java │ │ │ │ ├── ServletUtils.java │ │ │ │ ├── SkipPatternHttpClientSampler.java │ │ │ │ ├── SkipPatternHttpServerSampler.java │ │ │ │ └── SkipPatternSampler.java │ │ │ ├── propagation │ │ │ ├── PropagationFactorySupplier.java │ │ │ └── PropagationType.java │ │ │ └── sampler │ │ │ ├── ProbabilityBasedSampler.java │ │ │ └── RateLimitingSampler.java │ │ └── jms │ │ └── config │ │ └── TracingJmsListenerEndpointRegistry.java │ └── test │ ├── java │ └── org │ │ └── springframework │ │ └── cloud │ │ └── sleuth │ │ ├── ArchitectureTests.java │ │ ├── brave │ │ ├── SpringCloudSleuthDocTests.java │ │ ├── bridge │ │ │ ├── BraveContextWrappingFunctionTests.java │ │ │ ├── BraveCurrentTraceContextTests.java │ │ │ ├── BraveHttpClientHandlerTests.java │ │ │ ├── BraveTraceContextBuilderTests.java │ │ │ ├── BraveTracerTests.java │ │ │ ├── W3CBaggagePropagatorTest.java │ │ │ └── W3CPropagationTest.java │ │ ├── instrument │ │ │ ├── messaging │ │ │ │ ├── KafkaFactoryBeanPostProcessorTests.java │ │ │ │ ├── TraceConsumerPostProcessorTests.java │ │ │ │ └── TraceProducerPostProcessorTests.java │ │ │ └── web │ │ │ │ ├── BraveSpanFromContextRetrieverTests.java │ │ │ │ ├── CompositeHttpSamplerTests.java │ │ │ │ └── SkipPatternSamplerTests.java │ │ └── sampler │ │ │ └── ProbabilityBasedSamplerTests.java │ │ └── internal │ │ ├── LazyBeanTests.java │ │ └── SpanNameUtilTests.java │ └── resources │ ├── META-INF │ └── spring.factories │ ├── application-baggage.yml │ ├── application.yml │ ├── beans │ └── applicationContext.xml │ ├── bootstrap-disabled.yml │ └── logback.xml ├── spring-cloud-sleuth-dependencies ├── .flattened-pom.xml └── pom.xml ├── spring-cloud-sleuth-instrumentation ├── pom.xml └── src │ ├── main │ ├── java │ │ └── org │ │ │ └── springframework │ │ │ └── cloud │ │ │ └── sleuth │ │ │ ├── instrument │ │ │ ├── annotation │ │ │ │ ├── AbstractSleuthMethodInvocationProcessor.java │ │ │ │ ├── DefaultSpanCreator.java │ │ │ │ ├── NonReactorSleuthMethodInvocationProcessor.java │ │ │ │ ├── ReactorSleuthMethodInvocationProcessor.java │ │ │ │ ├── SleuthAdvisorConfig.java │ │ │ │ ├── SleuthAnnotatedParameter.java │ │ │ │ ├── SleuthAnnotationSpan.java │ │ │ │ ├── SleuthAnnotationUtils.java │ │ │ │ ├── SpanTagAnnotationHandler.java │ │ │ │ └── SpelTagValueExpressionResolver.java │ │ │ ├── async │ │ │ │ ├── ExecutorInstrumentor.java │ │ │ │ ├── LazyTraceAsyncCustomizer.java │ │ │ │ ├── LazyTraceAsyncTaskExecutor.java │ │ │ │ ├── LazyTraceExecutor.java │ │ │ │ ├── LazyTraceScheduledThreadPoolExecutor.java │ │ │ │ ├── LazyTraceThreadPoolTaskExecutor.java │ │ │ │ ├── LazyTraceThreadPoolTaskScheduler.java │ │ │ │ ├── SleuthAsyncSpan.java │ │ │ │ ├── TraceAsyncAspect.java │ │ │ │ ├── TraceAsyncListenableTaskExecutor.java │ │ │ │ ├── TraceCallable.java │ │ │ │ ├── TraceRunnable.java │ │ │ │ ├── TraceableExecutorService.java │ │ │ │ └── TraceableScheduledExecutorService.java │ │ │ ├── batch │ │ │ │ ├── SleuthBatchSpan.java │ │ │ │ ├── TraceJobBuilderFactory.java │ │ │ │ ├── TraceJobExecutionListener.java │ │ │ │ ├── TraceStepBuilderFactory.java │ │ │ │ └── TraceStepExecutionListener.java │ │ │ ├── cassandra │ │ │ │ ├── CassandraSpanCustomizer.java │ │ │ │ ├── CassandraSpanSupplier.java │ │ │ │ ├── SleuthCassandraSpan.java │ │ │ │ ├── TraceCqlSession.java │ │ │ │ ├── TraceCqlSessionBuilderCustomizer.java │ │ │ │ ├── TraceCqlSessionInterceptor.java │ │ │ │ ├── TraceReactiveSession.java │ │ │ │ ├── TraceRequestTracker.java │ │ │ │ └── TraceStatement.java │ │ │ ├── circuitbreaker │ │ │ │ ├── SleuthCircuitBreakerSpan.java │ │ │ │ ├── TraceCircuitBreaker.java │ │ │ │ ├── TraceCircuitBreakerFactoryAspect.java │ │ │ │ ├── TraceFunction.java │ │ │ │ ├── TraceReactiveCircuitBreaker.java │ │ │ │ ├── TraceReactiveCircuitBreakerFactoryAspect.java │ │ │ │ └── TraceSupplier.java │ │ │ ├── config │ │ │ │ ├── SleuthConfigSpan.java │ │ │ │ └── TraceEnvironmentRepositoryAspect.java │ │ │ ├── deployer │ │ │ │ ├── SleuthDeployerSpan.java │ │ │ │ └── TraceAppDeployer.java │ │ │ ├── jdbc │ │ │ │ ├── DataSourceDecorator.java │ │ │ │ ├── DataSourceNameResolver.java │ │ │ │ ├── DataSourceProxyBuilderCustomizer.java │ │ │ │ ├── DataSourceProxyConnectionIdManagerProvider.java │ │ │ │ ├── DataSourceProxyDataSourceDecorator.java │ │ │ │ ├── DataSourceProxyProperties.java │ │ │ │ ├── DataSourceWrapper.java │ │ │ │ ├── P6SpyContextJdbcEventListenerFactory.java │ │ │ │ ├── P6SpyDataSourceDecorator.java │ │ │ │ ├── SleuthJdbcSpan.java │ │ │ │ ├── SpanNameProvider.java │ │ │ │ ├── TraceHikariListenerStrategySpanCustomizer.java │ │ │ │ ├── TraceJdbcEventListener.java │ │ │ │ ├── TraceListenerStrategy.java │ │ │ │ ├── TraceListenerStrategySpanCustomizer.java │ │ │ │ ├── TraceQueryExecutionListener.java │ │ │ │ └── TraceType.java │ │ │ ├── kafka │ │ │ │ ├── KafkaTracingCallback.java │ │ │ │ ├── KafkaTracingUtils.java │ │ │ │ ├── ReactiveKafkaTracingPropagator.java │ │ │ │ ├── SleuthKafkaSpan.java │ │ │ │ ├── TracingKafkaAspect.java │ │ │ │ ├── TracingKafkaConsumer.java │ │ │ │ ├── TracingKafkaConsumerFactory.java │ │ │ │ ├── TracingKafkaProducer.java │ │ │ │ ├── TracingKafkaProducerFactory.java │ │ │ │ ├── TracingKafkaPropagatorGetter.java │ │ │ │ ├── TracingKafkaPropagatorSetter.java │ │ │ │ ├── TracingKafkaReceiver.java │ │ │ │ └── TracingMessageListenerMethodInterceptor.java │ │ │ ├── messaging │ │ │ │ ├── DefaultMessageSpanCustomizer.java │ │ │ │ ├── FunctionMessageSpanCustomizer.java │ │ │ │ ├── MessageHeaderPropagatorGetter.java │ │ │ │ ├── MessageHeaderPropagatorSetter.java │ │ │ │ ├── MessageSpanCustomizer.java │ │ │ │ ├── MessagingSleuthOperators.java │ │ │ │ ├── SleuthMessagingSpan.java │ │ │ │ ├── TraceFunctionAroundWrapper.java │ │ │ │ ├── TraceMessageHandler.java │ │ │ │ ├── TraceMessagingAspect.java │ │ │ │ └── TracingChannelInterceptor.java │ │ │ ├── mongodb │ │ │ │ ├── TraceAllTypesMongoClientSettingsBuilderCustomizer.java │ │ │ │ ├── TraceMongoClientSettingsBuilderCustomizer.java │ │ │ │ ├── TraceMongoClusterIdSpanCustomizer.java │ │ │ │ ├── TraceMongoCommandListener.java │ │ │ │ ├── TraceMongoSocketAddressSpanCustomizer.java │ │ │ │ ├── TraceMongoSpanCustomizer.java │ │ │ │ ├── TraceReactiveMongoClientSettingsBuilderCustomizer.java │ │ │ │ ├── TraceRequestContext.java │ │ │ │ └── TraceSynchronousMongoClientSettingsBuilderCustomizer.java │ │ │ ├── prometheus │ │ │ │ ├── LazySleuthSpanContextSupplier.java │ │ │ │ └── SleuthSpanContextSupplier.java │ │ │ ├── quartz │ │ │ │ ├── SleuthQuartzSpan.java │ │ │ │ └── TracingJobListener.java │ │ │ ├── r2dbc │ │ │ │ ├── SleuthR2dbcSpan.java │ │ │ │ └── TraceProxyExecutionListener.java │ │ │ ├── reactor │ │ │ │ ├── ReactorHooksHelper.java │ │ │ │ ├── ReactorSleuth.java │ │ │ │ ├── ScopePassingSpanSubscriber.java │ │ │ │ ├── SpanSubscription.java │ │ │ │ └── TraceContextPropagator.java │ │ │ ├── redis │ │ │ │ └── TraceLettuceClientResourcesBuilderCustomizer.java │ │ │ ├── rsocket │ │ │ │ ├── ByteBufGetter.java │ │ │ │ ├── ByteBufSetter.java │ │ │ │ ├── CompositeMetadataUtils.java │ │ │ │ ├── PayloadUtils.java │ │ │ │ ├── SleuthRSocketSpan.java │ │ │ │ ├── TracingRSocketConnectorConfigurer.java │ │ │ │ ├── TracingRSocketServerCustomizer.java │ │ │ │ ├── TracingRequesterRSocketProxy.java │ │ │ │ └── TracingResponderRSocketProxy.java │ │ │ ├── rxjava │ │ │ │ ├── SleuthRxJavaSchedulersHook.java │ │ │ │ └── SleuthRxJavaSpan.java │ │ │ ├── scheduling │ │ │ │ ├── SleuthSchedulingSpan.java │ │ │ │ └── TraceSchedulingAspect.java │ │ │ ├── security │ │ │ │ ├── SleuthSecuritySpan.java │ │ │ │ └── TracingSecurityContextChangedListener.java │ │ │ ├── session │ │ │ │ ├── SleuthSessionSpan.java │ │ │ │ ├── TraceFindByIndexNameSessionRepository.java │ │ │ │ ├── TraceReactiveSessionRepository.java │ │ │ │ ├── TraceSessionRepository.java │ │ │ │ └── TraceSessionRepositoryAspect.java │ │ │ ├── task │ │ │ │ ├── SleuthTaskSpan.java │ │ │ │ ├── TraceApplicationRunner.java │ │ │ │ ├── TraceCommandLineRunner.java │ │ │ │ └── TraceTaskExecutionListener.java │ │ │ ├── tx │ │ │ │ ├── SleuthTxSpan.java │ │ │ │ ├── TraceKafkaAwareTransactionManager.java │ │ │ │ ├── TracePlatformTransactionManager.java │ │ │ │ ├── TracePlatformTransactionManagerTags.java │ │ │ │ └── TraceReactiveTransactionManager.java │ │ │ └── web │ │ │ │ ├── HttpClientRequestParser.java │ │ │ │ ├── HttpClientResponseParser.java │ │ │ │ ├── HttpClientSampler.java │ │ │ │ ├── HttpServerRequestParser.java │ │ │ │ ├── HttpServerResponseParser.java │ │ │ │ ├── HttpServerSampler.java │ │ │ │ ├── SkipPatternProvider.java │ │ │ │ ├── SleuthWebSpan.java │ │ │ │ ├── SpanFromContextRetriever.java │ │ │ │ ├── TraceHandlerAdapter.java │ │ │ │ ├── TraceHandlerFunction.java │ │ │ │ ├── TraceWebAspect.java │ │ │ │ ├── TraceWebFilter.java │ │ │ │ ├── WebFluxSleuthOperators.java │ │ │ │ ├── client │ │ │ │ ├── AbstractHttpHeadersFilter.java │ │ │ │ ├── HttpClientBeanPostProcessor.java │ │ │ │ ├── LazyTraceClientHttpRequestInterceptor.java │ │ │ │ ├── RestTemplateInterceptorInjector.java │ │ │ │ ├── TraceDefaultOAuth2UserServiceCustomizer.java │ │ │ │ ├── TraceExchangeFilterFunction.java │ │ │ │ ├── TraceRequestHttpHeadersFilter.java │ │ │ │ ├── TraceResponseHttpHeadersFilter.java │ │ │ │ ├── TraceRestTemplateBeanPostProcessor.java │ │ │ │ ├── TraceRestTemplateCustomizer.java │ │ │ │ ├── TraceUserInfoRestTemplateCustomizer.java │ │ │ │ ├── TraceWebClientBeanPostProcessor.java │ │ │ │ ├── UserInfoRestTemplateCustomizerBeanPostProcessor.java │ │ │ │ └── feign │ │ │ │ │ ├── FeignContextBeanPostProcessor.java │ │ │ │ │ ├── LazyClient.java │ │ │ │ │ ├── LazyTracingFeignClient.java │ │ │ │ │ ├── OkHttpFeignClientBeanPostProcessor.java │ │ │ │ │ ├── SleuthFeignBuilder.java │ │ │ │ │ ├── TraceFeignAspect.java │ │ │ │ │ ├── TraceFeignBlockingLoadBalancerClient.java │ │ │ │ │ ├── TraceFeignBuilderBeanPostProcessor.java │ │ │ │ │ ├── TraceFeignContext.java │ │ │ │ │ ├── TraceFeignObjectWrapper.java │ │ │ │ │ ├── TraceRetryableFeignBlockingLoadBalancerClient.java │ │ │ │ │ └── TracingFeignClient.java │ │ │ │ ├── mvc │ │ │ │ ├── HandlerParser.java │ │ │ │ ├── SleuthMvcSpan.java │ │ │ │ ├── SpanCustomizingAsyncHandlerInterceptor.java │ │ │ │ ├── SpanCustomizingHandlerInterceptor.java │ │ │ │ ├── TraceContextListenableFuture.java │ │ │ │ ├── TracingAsyncClientHttpRequestInterceptor.java │ │ │ │ ├── TracingClientHttpRequestInterceptor.java │ │ │ │ ├── WebMvcRuntime.java │ │ │ │ └── package-info.java │ │ │ │ ├── servlet │ │ │ │ ├── HttpServletRequestWrapper.java │ │ │ │ ├── HttpServletResponseWrapper.java │ │ │ │ ├── ServletRuntime.java │ │ │ │ ├── TracingFilter.java │ │ │ │ └── package-info.java │ │ │ │ └── tomcat │ │ │ │ └── TraceValve.java │ │ │ └── internal │ │ │ ├── ContextUtil.java │ │ │ ├── DefaultSpanNamer.java │ │ │ ├── EncodingUtils.java │ │ │ ├── LazyBean.java │ │ │ ├── SleuthContextListener.java │ │ │ └── SpanNameUtil.java │ └── kotlin │ │ └── org │ │ └── springframework │ │ └── cloud │ │ └── sleuth │ │ └── instrument │ │ └── kotlin │ │ ├── KotlinContextElement.java │ │ └── asContextElement.kt │ └── test │ ├── java │ └── org │ │ └── springframework │ │ └── cloud │ │ └── sleuth │ │ ├── ArchitectureTests.java │ │ ├── annotation │ │ ├── NoOpTagValueResolverTests.java │ │ └── SpelTagValueExpressionResolverTests.java │ │ ├── instrument │ │ ├── async │ │ │ ├── ExecutorInstrumentorTests.java │ │ │ ├── LazyTraceAsyncCustomizerTest.java │ │ │ ├── LazyTraceScheduledThreadPoolExecutorTests.java │ │ │ └── LazyTraceThreadPoolTaskExecutorTests.java │ │ ├── cassandra │ │ │ ├── TraceCqlSessionBuilderCustomizerTests.java │ │ │ ├── TraceCqlSessionInterceptorTests.java │ │ │ ├── TraceReactiveSessionTests.java │ │ │ └── TraceRequestTrackerTests.java │ │ ├── deployer │ │ │ └── TraceAppDeployerTests.java │ │ ├── jdbc │ │ │ ├── ContextJdbcEventListenerFactoryTest.java │ │ │ ├── DataSourceNameResolverTests.java │ │ │ └── SpanNameProviderTest.java │ │ ├── kafka │ │ │ ├── KafkaTracingCallbackTest.java │ │ │ ├── TracingKafkaConsumerTest.java │ │ │ ├── TracingKafkaProducerTest.java │ │ │ └── TracingKafkaReceiverTest.java │ │ ├── messaging │ │ │ └── TraceFunctionAroundWrapperTests.java │ │ ├── prometheus │ │ │ ├── LazySleuthSpanContextSupplierTests.java │ │ │ └── SleuthSpanContextSupplierTests.java │ │ ├── r2dbc │ │ │ └── TraceProxyExecutionListenerTests.java │ │ ├── reactor │ │ │ └── ReactorHooksHelperTests.java │ │ ├── rsocket │ │ │ └── TracingRequesterRSocketProxyTest.java │ │ ├── security │ │ │ └── TracingSecurityContextChangedListenerTests.java │ │ ├── session │ │ │ ├── TraceFindByIndexNameSessionRepositoryTests.java │ │ │ ├── TraceReactiveSessionRepositoryTests.java │ │ │ ├── TraceSessionRepositoryAspectTests.java │ │ │ └── TraceSessionRepositoryTests.java │ │ ├── tx │ │ │ ├── TraceKafkaPlatformTransactionManagerTests.java │ │ │ └── TracePlatformTransactionManagerTests.java │ │ └── web │ │ │ ├── client │ │ │ ├── TraceDefaultOAuth2UserServiceCustomizerTests.java │ │ │ ├── TraceExchangeFilterFunctionHttpClientResponseTests.java │ │ │ ├── TraceWebClientBeanPostProcessorTest.java │ │ │ └── feign │ │ │ │ ├── FeignContextBeanPostProcessorTest.java │ │ │ │ ├── SleuthFeignBuilderTests.java │ │ │ │ └── TracingFeignObjectWrapperTests.java │ │ │ └── tomcat │ │ │ └── TraceValveTests.java │ │ ├── internal │ │ ├── DefaultSpanNamerTest.java │ │ ├── EncodingUtilsTests.java │ │ └── SleuthContextListenerTest.java │ │ └── tracer │ │ ├── NoOpSpanInScope.java │ │ ├── NoOpTraceContext.java │ │ ├── SimpleCurrentTraceContext.java │ │ ├── SimpleSpan.java │ │ ├── SimpleSpanBuilder.java │ │ └── SimpleTracer.java │ ├── kotlin │ └── org │ │ └── springframework │ │ └── cloud │ │ └── sleuth │ │ └── instrument │ │ └── kotlin │ │ └── AsContextElementKtTests.kt │ └── resources │ ├── META-INF │ └── spring.factories │ ├── application.yml │ └── logback.xml ├── spring-cloud-sleuth-samples ├── README.adoc ├── pom.xml ├── spring-cloud-sleuth-sample-feign │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── java │ │ │ └── sample │ │ │ │ ├── SampleController.java │ │ │ │ └── SampleFeignApplication.java │ │ └── resources │ │ │ └── application.yml │ │ └── test │ │ └── java │ │ └── sample │ │ └── SampleFeignApplicationTests.java ├── spring-cloud-sleuth-sample-messaging │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── java │ │ │ └── sample │ │ │ │ ├── SampleBackground.java │ │ │ │ ├── SampleMessagingApplication.java │ │ │ │ ├── SampleRequestResponse.java │ │ │ │ ├── SampleService.java │ │ │ │ ├── SampleSink.java │ │ │ │ └── SampleTransformer.java │ │ └── resources │ │ │ └── application.yml │ │ └── test │ │ └── java │ │ ├── integration │ │ ├── IntegrationTestZipkinSpanHandler.java │ │ └── MessagingApplicationTests.java │ │ └── sample │ │ └── SampleMessagingApplicationTests.java ├── spring-cloud-sleuth-sample-test-core │ ├── pom.xml │ └── src │ │ └── main │ │ └── java │ │ └── tools │ │ ├── AbstractIntegrationTest.java │ │ ├── AssertingRestTemplate.java │ │ ├── RequestSendingRunnable.java │ │ └── SpanUtil.java ├── spring-cloud-sleuth-sample-websocket │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── java │ │ │ └── sample │ │ │ │ ├── GreetingController.java │ │ │ │ └── SampleWebsocketApplication.java │ │ └── resources │ │ │ ├── application.yml │ │ │ └── static │ │ │ ├── index.html │ │ │ ├── sockjs-0.3.4.js │ │ │ └── stomp.js │ │ └── test │ │ └── java │ │ └── sample │ │ └── SampleWebsocketApplicationTests.java ├── spring-cloud-sleuth-sample-zipkin │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── java │ │ │ └── sample │ │ │ │ ├── SampleBackground.java │ │ │ │ ├── SampleController.java │ │ │ │ └── SampleZipkinApplication.java │ │ └── resources │ │ │ └── application.yml │ │ └── test │ │ └── java │ │ ├── integration │ │ └── ZipkinTests.java │ │ └── sample │ │ └── SampleSleuthApplicationTests.java └── spring-cloud-sleuth-sample │ ├── pom.xml │ └── src │ ├── main │ ├── java │ │ └── sample │ │ │ ├── SampleBackground.java │ │ │ ├── SampleController.java │ │ │ └── SampleSleuthApplication.java │ └── resources │ │ └── application.yml │ └── test │ └── java │ └── sample │ └── SampleSleuthApplicationTests.java ├── spring-cloud-sleuth-zipkin ├── pom.xml └── src │ ├── main │ └── java │ │ └── org │ │ └── springframework │ │ └── cloud │ │ └── sleuth │ │ └── zipkin2 │ │ ├── CachingZipkinUrlExtractor.java │ │ ├── DefaultEndpointLocator.java │ │ ├── DefaultZipkinRestTemplateCustomizer.java │ │ ├── EndpointLocator.java │ │ ├── HttpSender.java │ │ ├── LoadBalancerClientZipkinLoadBalancer.java │ │ ├── RestTemplateSender.java │ │ ├── StaticInstanceZipkinLoadBalancer.java │ │ ├── WebClientSender.java │ │ ├── ZipkinHttpClientSender.java │ │ ├── ZipkinLoadBalancer.java │ │ ├── ZipkinProperties.java │ │ ├── ZipkinRestTemplateCustomizer.java │ │ ├── ZipkinRestTemplateProvider.java │ │ ├── ZipkinRestTemplateWrapper.java │ │ ├── ZipkinUrlExtractor.java │ │ └── ZipkinWebClientBuilderProvider.java │ └── test │ └── java │ └── org │ └── springframework │ └── cloud │ └── sleuth │ └── zipkin2 │ ├── AbstractSenderTest.java │ ├── RestTemplateSenderTest.java │ ├── WebClientSenderTests.java │ └── ZipkinRestTemplateSenderConfigurationTest.java ├── spring-cloud-starter-sleuth └── pom.xml ├── src └── checkstyle │ └── checkstyle-suppressions.xml └── tests ├── brave ├── pom.xml ├── spring-cloud-sleuth-instrumentation-actuator-tests │ ├── pom.xml │ └── src │ │ └── test │ │ ├── java │ │ └── org │ │ │ └── springframework │ │ │ └── cloud │ │ │ └── sleuth │ │ │ └── brave │ │ │ └── autoconfig │ │ │ └── actuate │ │ │ └── TraceSleuthActuatorAutoConfigurationIntegrationTests.java │ │ └── resources │ │ └── application.yml ├── spring-cloud-sleuth-instrumentation-annotation-tests │ ├── pom.xml │ └── src │ │ └── test │ │ ├── java │ │ └── org │ │ │ └── springframework │ │ │ └── cloud │ │ │ └── sleuth │ │ │ └── brave │ │ │ └── annotation │ │ │ ├── NullSpanTagAnnotationHandlerTests.java │ │ │ ├── SleuthSpanCreatorAspectFluxTests.java │ │ │ ├── SleuthSpanCreatorAspectMonoTests.java │ │ │ ├── SleuthSpanCreatorAspectNegativeTests.java │ │ │ ├── SleuthSpanCreatorAspectTests.java │ │ │ ├── SleuthSpanCreatorCircularDependencyTests.java │ │ │ └── SpanTagAnnotationHandlerTests.java │ │ └── resources │ │ └── application.yml ├── spring-cloud-sleuth-instrumentation-async-tests │ ├── pom.xml │ └── src │ │ └── test │ │ ├── java │ │ └── org │ │ │ └── springframework │ │ │ └── cloud │ │ │ └── sleuth │ │ │ └── brave │ │ │ └── instrument │ │ │ └── async │ │ │ ├── AsyncDisabledTests.java │ │ │ ├── LazyTraceThreadPoolTaskSchedulerTests.java │ │ │ ├── TraceAsyncAspectTest.java │ │ │ ├── TraceAsyncIntegrationTests.java │ │ │ ├── TraceAsyncListenableTaskExecutorTest.java │ │ │ ├── TraceCallableTests.java │ │ │ ├── TraceRunnableTests.java │ │ │ ├── TraceScheduledThreadPoolExecutorAnotherConstructorTests.java │ │ │ ├── TraceScheduledThreadPoolExecutorTests.java │ │ │ ├── TraceThreadPoolTaskExecutorTests.java │ │ │ ├── TraceThreadPoolTaskSchedulerTests.java │ │ │ ├── TraceableExecutorServiceTests.java │ │ │ ├── TraceableScheduledExecutorServiceTest.java │ │ │ └── issues │ │ │ ├── issue1212 │ │ │ └── GH1212Tests.java │ │ │ ├── issue410 │ │ │ └── Issue410Tests.java │ │ │ └── issue546 │ │ │ └── Issue546Tests.java │ │ └── resources │ │ └── application.yml ├── spring-cloud-sleuth-instrumentation-baggage-tests │ ├── pom.xml │ └── src │ │ └── test │ │ ├── java │ │ └── org │ │ │ └── springframework │ │ │ └── cloud │ │ │ └── sleuth │ │ │ └── brave │ │ │ └── baggage │ │ │ ├── BaggageEntryTagSpanHandlerTest.java │ │ │ ├── MultipleHopsIntegrationTests.java │ │ │ └── W3CBaggageTests.java │ │ └── resources │ │ └── application.yml ├── spring-cloud-sleuth-instrumentation-batch-tests │ ├── pom.xml │ └── src │ │ └── test │ │ ├── java │ │ └── org │ │ │ └── springframework │ │ │ └── cloud │ │ │ └── sleuth │ │ │ └── brave │ │ │ └── instrument │ │ │ └── batch │ │ │ └── BatchIntegrationTests.java │ │ └── resources │ │ └── application.yml ├── spring-cloud-sleuth-instrumentation-circuitbreaker-reactive-tests │ ├── pom.xml │ └── src │ │ └── test │ │ ├── java │ │ └── org │ │ │ └── springframework │ │ │ └── cloud │ │ │ └── sleuth │ │ │ └── brave │ │ │ └── instrument │ │ │ └── circuitbreaker │ │ │ ├── ReactiveCircuitBreakerIntegrationTests.java │ │ │ └── ReactiveCircuitBreakerTests.java │ │ └── resources │ │ └── application.yml ├── spring-cloud-sleuth-instrumentation-circuitbreaker-tests │ ├── pom.xml │ └── src │ │ └── test │ │ ├── java │ │ └── org │ │ │ └── springframework │ │ │ └── cloud │ │ │ └── sleuth │ │ │ └── brave │ │ │ └── instrument │ │ │ └── circuitbreaker │ │ │ ├── CircuitBreakerIntegrationTests.java │ │ │ └── CircuitBreakerTests.java │ │ └── resources │ │ └── application.yml ├── spring-cloud-sleuth-instrumentation-config-server-tests │ ├── pom.xml │ └── src │ │ └── test │ │ ├── java │ │ └── org │ │ │ └── springframework │ │ │ └── cloud │ │ │ └── sleuth │ │ │ └── brave │ │ │ └── instrument │ │ │ └── config │ │ │ └── ConfigServerIntegrationTests.java │ │ └── resources │ │ └── application.yml ├── spring-cloud-sleuth-instrumentation-feign-tests │ ├── pom.xml │ └── src │ │ └── test │ │ ├── java │ │ └── org │ │ │ └── springframework │ │ │ └── cloud │ │ │ └── sleuth │ │ │ └── brave │ │ │ └── instrument │ │ │ └── feign │ │ │ ├── FeignRetriesTests.java │ │ │ ├── TraceFeignAspectTests.java │ │ │ ├── TracingFeignClientTests.java │ │ │ └── issues │ │ │ ├── issue1125 │ │ │ └── ManuallyCreatedLoadBalancerFeignClientTests.java │ │ │ ├── issue1125delegates │ │ │ └── ManuallyCreatedDelegateLoadBalancerFeignClientTests.java │ │ │ ├── issue307 │ │ │ └── Issue307Tests.java │ │ │ ├── issue362 │ │ │ └── Issue362Tests.java │ │ │ ├── issue393 │ │ │ └── Issue393Tests.java │ │ │ └── issue502 │ │ │ └── Issue502Tests.java │ │ └── resources │ │ └── application.yml ├── spring-cloud-sleuth-instrumentation-gateway-tests │ ├── pom.xml │ └── src │ │ └── test │ │ ├── java │ │ └── org │ │ │ └── springframework │ │ │ └── cloud │ │ │ └── sleuth │ │ │ └── brave │ │ │ └── instrument │ │ │ └── web │ │ │ └── client │ │ │ ├── TraceRequestHttpHeadersFilterTests.java │ │ │ ├── TraceResponseHttpHeadersFilterTests.java │ │ │ └── reactor │ │ │ └── netty │ │ │ ├── LoggingTest.java │ │ │ └── ReuseTraceIdTest.java │ │ └── resources │ │ └── application.yml ├── spring-cloud-sleuth-instrumentation-grpc-tests │ ├── pom.xml │ └── src │ │ └── test │ │ ├── java │ │ └── org │ │ │ └── springframework │ │ │ └── cloud │ │ │ └── sleuth │ │ │ ├── brave │ │ │ └── instrument │ │ │ │ └── grpc │ │ │ │ └── GrpcTracingIntegrationTests.java │ │ │ └── instrument │ │ │ └── grpc │ │ │ └── stubs │ │ │ ├── HelloReply.java │ │ │ ├── HelloReplyOrBuilder.java │ │ │ ├── HelloRequest.java │ │ │ ├── HelloRequestOrBuilder.java │ │ │ ├── HelloServiceGrpc.java │ │ │ └── HelloServiceOuterClass.java │ │ └── resources │ │ └── application.yml ├── spring-cloud-sleuth-instrumentation-jdbc-tests │ ├── pom.xml │ └── src │ │ └── test │ │ ├── java │ │ └── org │ │ │ └── springframework │ │ │ └── cloud │ │ │ └── sleuth │ │ │ └── brave │ │ │ └── instrument │ │ │ └── jdbc │ │ │ ├── TraceJdbcEventListenerTests.java │ │ │ └── TraceQueryExecutionListenerTests.java │ │ └── resources │ │ └── application.yml ├── spring-cloud-sleuth-instrumentation-kafka-tests │ ├── pom.xml │ └── src │ │ └── test │ │ └── java │ │ └── org │ │ └── springframework │ │ └── cloud │ │ └── sleuth │ │ └── brave │ │ └── instrument │ │ └── kafka │ │ ├── KafkaConsumerTest.java │ │ ├── KafkaProducerTest.java │ │ ├── KafkaReceiverTest.java │ │ ├── KafkaSenderTest.java │ │ ├── TracingKafkaAutoConfigurationTest.java │ │ └── TracingReactorKafkaAutoConfigurationTest.java ├── spring-cloud-sleuth-instrumentation-kotlin-tests │ ├── pom.xml │ └── src │ │ └── test │ │ └── kotlin │ │ └── org │ │ └── springframework │ │ └── cloud │ │ └── sleuth │ │ └── kotlin │ │ └── SleuthCoroutinesApplicationTests.kt ├── spring-cloud-sleuth-instrumentation-lettuce-tests │ ├── pom.xml │ └── src │ │ └── test │ │ ├── java │ │ └── org │ │ │ └── springframework │ │ │ └── cloud │ │ │ └── sleuth │ │ │ └── brave │ │ │ └── instrument │ │ │ └── redis │ │ │ ├── BraveLettuceIntegrationTests.java │ │ │ └── BraveRedisAutoConfigurationTests.java │ │ └── resources │ │ └── application.yml ├── spring-cloud-sleuth-instrumentation-messaging-tests │ ├── activemq-data │ │ └── localhost │ │ │ └── KahaDB │ │ │ ├── db.data │ │ │ ├── db.redo │ │ │ └── lock │ ├── pom.xml │ └── src │ │ └── test │ │ ├── java │ │ └── org │ │ │ └── springframework │ │ │ └── cloud │ │ │ └── sleuth │ │ │ ├── brave │ │ │ └── instrument │ │ │ │ └── messaging │ │ │ │ ├── BraveMessagingAutoConfiguration1664Tests.java │ │ │ │ ├── BraveMessagingAutoConfigurationTests.java │ │ │ │ ├── TraceWebSocketAutoConfigurationTests.java │ │ │ │ └── TracingChannelInterceptorTest.java │ │ │ └── instrument │ │ │ ├── messaging │ │ │ ├── BraveTraceFunctionAwareWrapperTests.java │ │ │ ├── ITTracingChannelInterceptorTests.java │ │ │ ├── JmsTracingConfigurationTest.java │ │ │ ├── StreamFunctionAdapterTests.java │ │ │ ├── StreamMessageOperatorsTests.java │ │ │ ├── TraceContextPropagationChannelInterceptorTests.java │ │ │ ├── TraceStreamChannelInterceptorTests.java │ │ │ └── issues │ │ │ │ └── issue_943 │ │ │ │ ├── CustomExecutorConfig.java │ │ │ │ ├── HelloSpringIntegration.java │ │ │ │ ├── HelloWorldImpl.java │ │ │ │ ├── HelloWorldRestController.java │ │ │ │ ├── Issue943Tests.java │ │ │ │ └── MessagingGateway.java │ │ │ └── util │ │ │ └── SpanUtil.java │ │ └── resources │ │ ├── application.yml │ │ ├── beans │ │ └── applicationContext.xml │ │ └── logback.xml ├── spring-cloud-sleuth-instrumentation-mongodb-tests │ ├── pom.xml │ └── src │ │ └── test │ │ ├── java │ │ └── org │ │ │ └── springframework │ │ │ └── cloud │ │ │ └── sleuth │ │ │ └── brave │ │ │ └── instrument │ │ │ └── mongodb │ │ │ └── ReactiveMongoDbIntegrationTests.java │ │ └── resources │ │ └── application.yml ├── spring-cloud-sleuth-instrumentation-mvc-tests │ ├── pom.xml │ └── src │ │ └── test │ │ ├── java │ │ └── org │ │ │ └── springframework │ │ │ └── cloud │ │ │ └── sleuth │ │ │ ├── brave │ │ │ └── instrument │ │ │ │ └── web │ │ │ │ ├── AbstractMvcIntegrationTest.java │ │ │ │ ├── HttpServerParserTests.java │ │ │ │ ├── IgnoreAutoConfiguredSkipPatternsIntegrationTests.java │ │ │ │ ├── SkipEndPointsIntegrationTestsWithContextPathWithBasePath.java │ │ │ │ ├── SkipEndPointsIntegrationTestsWithContextPathWithoutBasePath.java │ │ │ │ ├── SkipEndPointsIntegrationTestsWithoutContextPathWithBasePath.java │ │ │ │ ├── SkipEndPointsIntegrationTestsWithoutContextPathWithoutBasePath.java │ │ │ │ ├── TraceAsyncIntegrationTests.java │ │ │ │ ├── TraceCustomFilterResponseInjectorTests.java │ │ │ │ ├── TraceCustomHandlerParserPostHandleWebIntegrationTests.java │ │ │ │ ├── TraceFilterIntegrationTests.java │ │ │ │ ├── TraceFilterTests.java │ │ │ │ ├── TraceFilterWebIntegrationMultipleFiltersTests.java │ │ │ │ ├── TraceFilterWebIntegrationTests.java │ │ │ │ ├── TraceWebDisabledTests.java │ │ │ │ ├── client │ │ │ │ ├── MultipleAsyncRestTemplateTests.java │ │ │ │ ├── RestTemplateTraceAspectIntegrationTests.java │ │ │ │ ├── TraceRestTemplateInterceptorIntegrationTests.java │ │ │ │ ├── TraceRestTemplateInterceptorTests.java │ │ │ │ ├── TraceWebAsyncClientAutoConfigurationTests.java │ │ │ │ └── exceptionresolver │ │ │ │ │ └── Issue585Tests.java │ │ │ │ └── view │ │ │ │ ├── Issue469.java │ │ │ │ └── Issue469Tests.java │ │ │ └── util │ │ │ └── SpanUtil.java │ │ └── resources │ │ └── application.yml ├── spring-cloud-sleuth-instrumentation-quartz-tests │ ├── pom.xml │ └── src │ │ └── test │ │ ├── java │ │ └── org │ │ │ └── springframework │ │ │ └── cloud │ │ │ └── sleuth │ │ │ └── brave │ │ │ └── instrument │ │ │ └── quartz │ │ │ └── TracingJobListenerTest.java │ │ └── resources │ │ └── application.yml ├── spring-cloud-sleuth-instrumentation-r2dbc-tests │ ├── pom.xml │ └── src │ │ └── test │ │ ├── java │ │ └── org │ │ │ └── springframework │ │ │ └── cloud │ │ │ └── sleuth │ │ │ └── brave │ │ │ └── instrument │ │ │ └── r2dbc │ │ │ └── R2dbcIntegrationTests.java │ │ └── resources │ │ └── application.yml ├── spring-cloud-sleuth-instrumentation-reactor-tests │ ├── pom.xml │ └── src │ │ └── test │ │ ├── java │ │ └── org │ │ │ └── springframework │ │ │ └── cloud │ │ │ └── sleuth │ │ │ ├── brave │ │ │ └── instrument │ │ │ │ └── reactor │ │ │ │ ├── FlatMapTests.java │ │ │ │ ├── FlowsScopePassingSpanSubscriberTests.java │ │ │ │ ├── QueueWrapperTests.java │ │ │ │ ├── ScopePassingSpanSubscriberSpringBootTests.java │ │ │ │ └── ScopePassingSpanSubscriberTests.java │ │ │ └── instrument │ │ │ └── web │ │ │ └── client │ │ │ ├── ITSpringConfiguredReactorClient.java │ │ │ ├── ReactorNettyHttpClientBraveTests.java │ │ │ ├── TestHttpCallbackSubscriber.java │ │ │ └── WebClientBraveTests.java │ │ └── resources │ │ └── application.yml ├── spring-cloud-sleuth-instrumentation-rsocket-tests │ ├── pom.xml │ └── src │ │ └── test │ │ ├── java │ │ └── org │ │ │ └── springframework │ │ │ └── cloud │ │ │ └── sleuth │ │ │ └── brave │ │ │ └── instrument │ │ │ └── rsocket │ │ │ └── TraceRSocketTests.java │ │ └── resources │ │ └── logback.xml ├── spring-cloud-sleuth-instrumentation-rxjava-tests │ ├── pom.xml │ └── src │ │ └── test │ │ ├── java │ │ └── org │ │ │ └── springframework │ │ │ └── cloud │ │ │ └── sleuth │ │ │ └── instrument │ │ │ └── rxjava │ │ │ ├── SleuthRxJavaSchedulersHookTests.java │ │ │ └── SleuthRxJavaTests.java │ │ └── resources │ │ └── application.yml ├── spring-cloud-sleuth-instrumentation-scheduling-tests │ ├── pom.xml │ └── src │ │ └── test │ │ ├── java │ │ └── org │ │ │ └── springframework │ │ │ └── cloud │ │ │ └── sleuth │ │ │ └── instrument │ │ │ └── scheduling │ │ │ └── TracingOnScheduledTests.java │ │ └── resources │ │ └── application.yml ├── spring-cloud-sleuth-instrumentation-security-tests │ ├── pom.xml │ └── src │ │ └── test │ │ ├── java │ │ └── org │ │ │ └── springframework │ │ │ └── cloud │ │ │ └── sleuth │ │ │ └── brave │ │ │ └── instrument │ │ │ └── security │ │ │ └── TracingSecurityContextChangedListenerIntegrationTests.java │ │ └── resources │ │ └── application.yml ├── spring-cloud-sleuth-instrumentation-task-tests │ ├── pom.xml │ └── src │ │ └── test │ │ ├── java │ │ └── org │ │ │ └── springframework │ │ │ └── cloud │ │ │ └── sleuth │ │ │ └── brave │ │ │ └── instrument │ │ │ └── task │ │ │ └── SpringCloudTaskIntegrationTests.java │ │ └── resources │ │ └── application.yml ├── spring-cloud-sleuth-instrumentation-webflux-tests │ ├── pom.xml │ └── src │ │ └── test │ │ ├── java │ │ └── org │ │ │ └── springframework │ │ │ └── cloud │ │ │ └── sleuth │ │ │ └── brave │ │ │ ├── instrument │ │ │ └── web │ │ │ │ ├── GH1102Tests.java │ │ │ │ ├── TraceWebFluxTests.java │ │ │ │ └── client │ │ │ │ ├── HttpClientBeanPostProcessorTest.java │ │ │ │ ├── MergedFactory.java │ │ │ │ ├── ReactorNettyHttpClientSpringBootTests.java │ │ │ │ ├── WebClientCustomParserTests.java │ │ │ │ ├── WebClientDiscoveryExceptionTests.java │ │ │ │ ├── WebClientExceptionTests.java │ │ │ │ ├── WebClientNotSampledTests.java │ │ │ │ └── WebClientTests.java │ │ │ └── util │ │ │ └── SpanUtil.java │ │ └── resources │ │ └── logback.xml └── spring-cloud-sleuth-zipkin-tests │ ├── pom.xml │ └── src │ └── test │ ├── java │ └── org │ │ └── springframework │ │ └── cloud │ │ └── sleuth │ │ └── autoconfig │ │ └── zipkin2 │ │ ├── BraveDefaultEndpointLocatorConfigurationTest.java │ │ ├── BraveZipkinAutoConfigurationTests.java │ │ └── BraveZipkinDiscoveryClientTests.java │ └── resources │ └── application.yml ├── common ├── pom.xml └── src │ └── main │ ├── java │ └── org │ │ └── springframework │ │ └── cloud │ │ └── sleuth │ │ ├── autoconfig │ │ ├── actuate │ │ │ └── TraceSleuthActuatorAutoConfigurationIntegrationTests.java │ │ ├── instrument │ │ │ └── reactor │ │ │ │ └── Issue866Configuration.java │ │ └── zipkin2 │ │ │ ├── DefaultEndpointLocatorConfigurationTest.java │ │ │ └── ZipkinAutoConfigurationTests.java │ │ ├── baggage │ │ ├── BaggageEntryTagSpanHandlerTest.java │ │ ├── W3CBaggageTests.java │ │ └── multiple │ │ │ ├── DemoApplication.java │ │ │ └── MultipleHopsIntegrationTests.java │ │ ├── brave │ │ ├── BraveIntegrationTestTracing.java │ │ ├── BraveTestSpanHandler.java │ │ ├── BraveTestTracing.java │ │ ├── BraveTestTracingAssertions.java │ │ └── bridge │ │ │ └── BraveAccessor.java │ │ ├── instrument │ │ ├── annotation │ │ │ ├── NullSpanTagAnnotationHandlerTests.java │ │ │ ├── SleuthSpanCreatorAspectFluxTests.java │ │ │ ├── SleuthSpanCreatorAspectMonoTests.java │ │ │ ├── SleuthSpanCreatorAspectNegativeTests.java │ │ │ ├── SleuthSpanCreatorAspectTests.java │ │ │ ├── SleuthSpanCreatorCircularDependencyTests.java │ │ │ └── SpanTagAnnotationHandlerTests.java │ │ ├── async │ │ │ ├── AsyncDisabledTests.java │ │ │ ├── LazyTraceThreadPoolTaskSchedulerTests.java │ │ │ ├── TraceAsyncAspectTest.java │ │ │ ├── TraceAsyncListenableTaskExecutorTest.java │ │ │ ├── TraceCallableTests.java │ │ │ ├── TraceRunnableTests.java │ │ │ ├── TraceScheduledThreadPoolExecutorAnotherConstructorTests.java │ │ │ ├── TraceScheduledThreadPoolExecutorTests.java │ │ │ ├── TraceThreadPoolTaskExecutorTests.java │ │ │ ├── TraceThreadPoolTaskSchedulerTests.java │ │ │ ├── TraceableExecutorServiceTests.java │ │ │ └── TraceableScheduledExecutorServiceTest.java │ │ ├── batch │ │ │ └── BatchIntegrationTests.java │ │ ├── circuitbreaker │ │ │ ├── CircuitBreakerIntegrationTests.java │ │ │ ├── CircuitBreakerTests.java │ │ │ ├── ReactiveCircuitBreakerIntegrationTests.java │ │ │ └── ReactiveCircuitBreakerTests.java │ │ ├── config │ │ │ └── ConfigServerIntegrationTests.java │ │ ├── jdbc │ │ │ ├── TraceJdbcEventListenerTests.java │ │ │ ├── TraceListenerStrategyTests.java │ │ │ └── TraceQueryExecutionListenerTests.java │ │ ├── kafka │ │ │ ├── KafkaConsumerTest.java │ │ │ ├── KafkaProducerTest.java │ │ │ ├── KafkaReceiverTest.java │ │ │ ├── KafkaSenderTest.java │ │ │ └── KafkaTestUtils.java │ │ ├── messaging │ │ │ ├── TraceFunctionAroundWrapperTests.java │ │ │ ├── TraceWebSocketAutoConfigurationTests.java │ │ │ └── TracingChannelInterceptorTest.java │ │ ├── mongodb │ │ │ └── ReactiveMongoDbIntegrationTests.java │ │ ├── quartz │ │ │ └── TracingJobListenerTest.java │ │ ├── r2dbc │ │ │ ├── R2dbcIntegrationTests.java │ │ │ ├── ReactiveContinuedTransactionService.java │ │ │ ├── ReactiveCustomer.java │ │ │ ├── ReactiveCustomerRepository.java │ │ │ ├── ReactiveNestedTransactionService.java │ │ │ └── ReactiveNewTransactionService.java │ │ ├── reactor │ │ │ ├── FlowsScopePassingSpanSubscriberTests.java │ │ │ ├── QueueWrapperTests.java │ │ │ ├── ScopePassingSpanSubscriberSpringBootTests.java │ │ │ ├── ScopePassingSpanSubscriberTests.java │ │ │ └── sample │ │ │ │ ├── FlatMapTests.java │ │ │ │ ├── ManualRequestSender.java │ │ │ │ └── RequestSender.java │ │ ├── redis │ │ │ └── LettuceIntegrationTests.java │ │ ├── rsocket │ │ │ └── TraceRSocketTests.java │ │ ├── security │ │ │ └── SpringSecurityTests.java │ │ ├── task │ │ │ └── SpringCloudTaskIntegrationTests.java │ │ └── web │ │ │ ├── HttpServerParserTests.java │ │ │ ├── IgnoreAutoConfiguredSkipPatternsIntegrationTests.java │ │ │ ├── SkipEndPointsIntegrationTestsWithContextPathWithBasePath.java │ │ │ ├── SkipEndPointsIntegrationTestsWithContextPathWithoutBasePath.java │ │ │ ├── SkipEndPointsIntegrationTestsWithoutContextPathWithBasePath.java │ │ │ ├── SkipEndPointsIntegrationTestsWithoutContextPathWithoutBasePath.java │ │ │ ├── TraceCustomHandlerParserPostHandleWebIntegrationTests.java │ │ │ ├── TraceFilterTests.java │ │ │ └── client │ │ │ ├── HttpClientBeanPostProcessorTest.java │ │ │ ├── MultipleAsyncRestTemplateTests.java │ │ │ ├── ReactorNettyHttpClientSpringBootTests.java │ │ │ ├── TraceRequestHttpHeadersFilterTests.java │ │ │ ├── TraceResponseHttpHeadersFilterTests.java │ │ │ ├── TraceRestTemplateInterceptorIntegrationTests.java │ │ │ ├── TraceRestTemplateInterceptorTests.java │ │ │ ├── discoveryexception │ │ │ └── WebClientDiscoveryExceptionTests.java │ │ │ ├── exception │ │ │ └── WebClientExceptionTests.java │ │ │ ├── feign │ │ │ ├── FeignRetriesTests.java │ │ │ ├── TraceFeignAspectTests.java │ │ │ └── TracingFeignClientTests.java │ │ │ └── integration │ │ │ ├── notsampled │ │ │ └── WebClientNotSampledTests.java │ │ │ ├── parser │ │ │ └── WebClientCustomParserTests.java │ │ │ └── sampled │ │ │ └── WebClientTests.java │ │ ├── internal │ │ └── SleuthContextListenerAccessor.java │ │ ├── test │ │ ├── TestPropagator.java │ │ ├── TestSpanBuilder.java │ │ ├── TestSpanHandler.java │ │ ├── TestTracer.java │ │ ├── TestTracingAssertions.java │ │ ├── TestTracingAware.java │ │ ├── TestTracingAwareSupplier.java │ │ ├── TestTracingBeanPostProcessor.java │ │ └── TracerAware.java │ │ └── zipkin2 │ │ └── ZipkinDiscoveryClientTests.java │ ├── kotlin │ └── org │ │ └── springframework │ │ └── cloud │ │ └── sleuth │ │ └── kotlin │ │ └── SleuthCoroutinesApplicationTests.kt │ └── resources │ └── schema.sql └── pom.xml /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | end_of_line = lf 5 | insert_final_newline = true 6 | 7 | [*.java] 8 | indent_style = tab 9 | indent_size = 4 10 | continuation_indent_size = 8 11 | 12 | [*.kt] 13 | indent_style = tab 14 | indent_size = 4 15 | continuation_indent_size = 8 16 | 17 | [*.groovy] 18 | indent_style = tab 19 | indent_size = 4 20 | continuation_indent_size = 8 21 | 22 | [*.xml] 23 | indent_style = tab 24 | indent_size = 4 25 | continuation_indent_size = 8 26 | 27 | [*.yml] 28 | indent_style = space 29 | indent_size = 2 30 | 31 | [*.yaml] 32 | indent_style = space 33 | indent_size = 2 34 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # Normalize line endings to LF. 2 | * text eol=lf 3 | 4 | # Ensure that line endings for multipart files in spring-web are not modified. 5 | *.multipart -text 6 | 7 | # Ensure that line endings for DOS batch files are not modified. 8 | *.bat -text 9 | 10 | # Ensure the following are treated as binary. 11 | *.gif binary 12 | *.jar binary 13 | *.jpeg binary 14 | *.jpg binary 15 | *.png binary 16 | *.vsd binary 17 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | 21 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Describe the bug** 11 | Please provide details of the problem, including the version of Spring Cloud that you 12 | are using. 13 | 14 | **Sample** 15 | If possible, please provide a test case or a minimal **Maven** sample written in **Java** that reproduces 16 | the problem. This makes it much easier for us to diagnose the problem and to verify that 17 | we have fixed it. 18 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Is your feature request related to a problem? Please describe.** 11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 12 | 13 | **Describe the solution you'd like** 14 | A clear and concise description of what you want to happen. 15 | 16 | **Describe alternatives you've considered** 17 | A clear and concise description of any alternative solutions or features you've considered. 18 | 19 | **Additional context** 20 | Add any other context or screenshots about the feature request here. 21 | -------------------------------------------------------------------------------- /.github/dco.yml: -------------------------------------------------------------------------------- 1 | require: 2 | members: false 3 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *~ 2 | #* 3 | *# 4 | .#* 5 | .classpath 6 | .project 7 | .settings/ 8 | .springBeans 9 | .apt_generated/ 10 | target/ 11 | _site/ 12 | .idea 13 | *.iml 14 | *.swp 15 | .factorypath 16 | *.logtjmeter 17 | .checkstyle 18 | *.log 19 | .DS_Store 20 | /spring-cloud-sleuth-core/nb-configuration.xml 21 | /spring-cloud-sleuth-core/nbactions.xml 22 | jmh-result.csv 23 | pom.xml.versionsBackup 24 | .vscode 25 | .sts4-cache 26 | _includes 27 | .sdkmanrc 28 | results/jmh/*.csv -------------------------------------------------------------------------------- /.mvn/jvm.config: -------------------------------------------------------------------------------- 1 | -Xmx1024m -XX:CICompilerCount=1 -XX:TieredStopAtLevel=1 -Djava.security.egd=file:/dev/./urandom 2 | -------------------------------------------------------------------------------- /.mvn/maven.config: -------------------------------------------------------------------------------- 1 | -P spring 2 | -------------------------------------------------------------------------------- /.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-cloud/spring-cloud-sleuth/43744e8471f1629d26afafc3fa696b6b826a11a4/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2013-2018 the original author or authors. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # https://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | distributionUrl=https://repo1.maven.org/maven2/org/apache/maven/apache-maven/3.5.0/apache-maven-3.5.0-bin.zip 17 | -------------------------------------------------------------------------------- /.springformat: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /benchmarks/README.adoc: -------------------------------------------------------------------------------- 1 | == Spring Cloud Sleuth Benchmarks 2 | 3 | This module can run benchmarks using the following tools 4 | 5 | - JMH 6 | - JMeter 7 | 8 | === How to run it? 9 | 10 | In the root folder inside the `scripts` folder there are the following benchmark scripts: 11 | 12 | - runJmhBenchmark.sh 13 | - runJmeterBenchmarks.sh 14 | 15 | Just execute them from the root folder like this: 16 | 17 | [source] 18 | ---- 19 | ./scripts/runJmeterBenchmarks.sh 20 | ./scripts/runJmhBenchmarks.sh 21 | ---- 22 | 23 | === How do they work? 24 | 25 | For JMH we're building a shaded JAR file that is next executed. 26 | 27 | For JMeter we're running two applications, one with Sleuth, one without with Spring Boot Maven Plugin. 28 | Next a Maven JMeter plugin is executed that loads the `*.jmx` files, starts JMeter and prints out the results. 29 | At the end Spring Boot Maven Plugin stops the applications. 30 | 31 | === What are we testing? 32 | 33 | For now we're testing the performance impact of the following: 34 | 35 | - our custom Trace HTTP filter 36 | - instrumentation of controllers - `@Callable` returning and the sync one 37 | - instrumentation of RestTemplate 38 | - `@Async` annotated methods 39 | -------------------------------------------------------------------------------- /benchmarks/src/main/java/org/springframework/cloud/sleuth/benchmarks/app/mvc/controller/AsyncSimulationController.java: -------------------------------------------------------------------------------- 1 | package org.springframework.cloud.sleuth.benchmarks.app.mvc.controller; 2 | 3 | import java.util.concurrent.Callable; 4 | import java.util.concurrent.ExecutionException; 5 | import java.util.concurrent.ExecutorService; 6 | import java.util.concurrent.Executors; 7 | import java.util.concurrent.Future; 8 | 9 | import javax.annotation.PreDestroy; 10 | 11 | import org.springframework.scheduling.annotation.Async; 12 | import org.springframework.web.bind.annotation.RequestMapping; 13 | import org.springframework.web.bind.annotation.RestController; 14 | 15 | /** 16 | * @author Marcin Grzejszczak 17 | */ 18 | @RestController 19 | public class AsyncSimulationController { 20 | private final ExecutorService pool = Executors.newWorkStealingPool(); 21 | 22 | @RequestMapping("/foo") 23 | public String foo() { 24 | return "foo"; 25 | } 26 | 27 | @RequestMapping("/bar") 28 | public Callable bar() { 29 | return () -> "bar"; 30 | } 31 | 32 | @RequestMapping("/async") 33 | public String asyncHttp() throws ExecutionException, InterruptedException { 34 | return this.async().get(); 35 | } 36 | 37 | @Async 38 | public Future async() { 39 | return this.pool.submit(() -> "async"); 40 | } 41 | 42 | @PreDestroy 43 | public void clean() { 44 | this.pool.shutdownNow(); 45 | } 46 | 47 | public ExecutorService getPool() { 48 | return this.pool; 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /benchmarks/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | logging.level: 2 | org.springframework: ERROR 3 | org.springframework.sleuth: ERROR 4 | org.springframework.sleuth.benchmarks: INFO 5 | brave: ERROR 6 | -------------------------------------------------------------------------------- /benchmarks/src/test/java/org/springframework/cloud/sleuth/benchmarks/jmh/TracerImplementation.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.cloud.sleuth.benchmarks.jmh; 18 | 19 | public enum TracerImplementation { 20 | 21 | brave; 22 | 23 | @Override 24 | public String toString() { 25 | return this.name(); 26 | } 27 | 28 | } -------------------------------------------------------------------------------- /benchmarks/src/test/jmeter/jmeter.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2013-2018 the original author or authors. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # https://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | sampleresult.useNanoTime=true 17 | -------------------------------------------------------------------------------- /docs/.asciidoctorconfig.adoc: -------------------------------------------------------------------------------- 1 | // +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 | // + Initial AsciiDoc editor configuration file - V1.0 + 3 | // ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 4 | // 5 | // Did not found any configuration files, so create this at project root level. 6 | // If you do not like those files to be generated - you can turn it off inside Asciidoctor Editor preferences. 7 | // 8 | // You can define editor specific parts here. 9 | // For example: with next line you could set imagesdir attribute to subfolder "images" relative to the folder where this config file is located. 10 | // :imagesdir: {asciidoctorconfigdir}/images 11 | // 12 | // For more information please take a look at https://github.com/de-jcup/eclipse-asciidoctor-editor/wiki/Asciidoctor-configfiles 13 | -------------------------------------------------------------------------------- /docs/src/main/asciidoc/_attributes.adoc: -------------------------------------------------------------------------------- 1 | :doctype: book 2 | :idprefix: 3 | :idseparator: - 4 | :toc: left 5 | :toclevels: 4 6 | :tabsize: 4 7 | :numbered: 8 | :sectanchors: 9 | :sectnums: 10 | :icons: font 11 | :hide-uri-scheme: 12 | :docinfo: shared,private 13 | 14 | :sc-ext: java 15 | :project-full-name: Spring Cloud Sleuth 16 | 17 | // project-specific attributes 18 | :core_path: {project-root} 19 | :docs_path: {project-root}/docs 20 | :autoconfig_path: {project-root}/spring-cloud-sleuth-autoconfigure 21 | :api_path: {project-root}/spring-cloud-sleuth-api 22 | :brave_path: {project-root}/spring-cloud-sleuth-brave 23 | :tests_path: {core_path}/tests 24 | :common_tests_path: {tests_path}/common 25 | :brave_tests_path: {tests_path}/brave 26 | :github-raw: https://raw.githubusercontent.com/spring-cloud/spring-cloud-sleuth/main 27 | -------------------------------------------------------------------------------- /docs/src/main/asciidoc/appendix.adoc: -------------------------------------------------------------------------------- 1 | :numbered!: 2 | 3 | [[appendix]] 4 | [[common-application-properties]] 5 | == Common application properties 6 | 7 | include::_attributes.adoc[] 8 | 9 | Various properties can be specified inside your `application.properties` file, inside your `application.yml` file, or as command line switches. 10 | This appendix provides a list of common {project-full-name} properties and references to the underlying classes that consume them. 11 | 12 | NOTE: Property contributions can come from additional jar files on your classpath, so you should not consider this an exhaustive list. 13 | Also, you can define your own properties. 14 | 15 | include::_configprops.adoc[] 16 | 17 | [[sleuth-spans]] 18 | == Spring Cloud Sleuth Spans 19 | 20 | Below you can find a list of all the spans that are created by Spring Cloud Sleuth. 21 | 22 | include::_spans.adoc[] 23 | -------------------------------------------------------------------------------- /docs/src/main/asciidoc/images/.gitkeep: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /docs/src/main/asciidoc/images/kibana.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-cloud/spring-cloud-sleuth/43744e8471f1629d26afafc3fa696b6b826a11a4/docs/src/main/asciidoc/images/kibana.png -------------------------------------------------------------------------------- /docs/src/main/asciidoc/images/parents.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-cloud/spring-cloud-sleuth/43744e8471f1629d26afafc3fa696b6b826a11a4/docs/src/main/asciidoc/images/parents.jpg -------------------------------------------------------------------------------- /docs/src/main/asciidoc/images/trace-id.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-cloud/spring-cloud-sleuth/43744e8471f1629d26afafc3fa696b6b826a11a4/docs/src/main/asciidoc/images/trace-id.jpg -------------------------------------------------------------------------------- /docs/src/main/asciidoc/images/zipkin-dependencies.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-cloud/spring-cloud-sleuth/43744e8471f1629d26afafc3fa696b6b826a11a4/docs/src/main/asciidoc/images/zipkin-dependencies.png -------------------------------------------------------------------------------- /docs/src/main/asciidoc/images/zipkin-error-trace-screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-cloud/spring-cloud-sleuth/43744e8471f1629d26afafc3fa696b6b826a11a4/docs/src/main/asciidoc/images/zipkin-error-trace-screenshot.png -------------------------------------------------------------------------------- /docs/src/main/asciidoc/images/zipkin-error-trace.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-cloud/spring-cloud-sleuth/43744e8471f1629d26afafc3fa696b6b826a11a4/docs/src/main/asciidoc/images/zipkin-error-trace.png -------------------------------------------------------------------------------- /docs/src/main/asciidoc/images/zipkin-error-traces.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-cloud/spring-cloud-sleuth/43744e8471f1629d26afafc3fa696b6b826a11a4/docs/src/main/asciidoc/images/zipkin-error-traces.png -------------------------------------------------------------------------------- /docs/src/main/asciidoc/images/zipkin-trace-screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-cloud/spring-cloud-sleuth/43744e8471f1629d26afafc3fa696b6b826a11a4/docs/src/main/asciidoc/images/zipkin-trace-screenshot.png -------------------------------------------------------------------------------- /docs/src/main/asciidoc/index.adoc: -------------------------------------------------------------------------------- 1 | include::spring-cloud-sleuth.adoc[] 2 | -------------------------------------------------------------------------------- /docs/src/main/asciidoc/legal.adoc: -------------------------------------------------------------------------------- 1 | [[legal]] 2 | = Legal 3 | 4 | {project-version} 5 | 6 | Copyright © 2012-2023 7 | 8 | Copies of this document may be made for your own use and for distribution to others, provided that you do not charge any fee for such copies and further provided that each copy contains this Copyright Notice, whether distributed in print or electronically. 9 | -------------------------------------------------------------------------------- /docs/src/main/asciidoc/sagan-index.adoc: -------------------------------------------------------------------------------- 1 | Spring Cloud Sleuth provides Spring Boot auto-configuration for distributed tracing. 2 | 3 | ## Features 4 | 5 | Sleuth configures everything you need to get started. 6 | This includes where trace data (spans) are reported to, how many traces to keep (sampling), if remote fields (baggage) are sent, and which libraries are traced. 7 | 8 | Specifically, Spring Cloud Sleuth... 9 | 10 | * Adds trace and span ids to the Slf4J MDC, so you can extract all the logs from a given trace or span in a log aggregator. 11 | * Instruments common ingress and egress points from Spring applications (servlet filter, rest template, scheduled actions, message channels, feign client). 12 | * If `spring-cloud-sleuth-zipkin` is available then the app will generate and report https://zipkin.io[Zipkin]-compatible traces via HTTP. By default it sends them to a Zipkin collector service on localhost (port 9411). 13 | Configure the location of the service using `spring.zipkin.baseUrl`. 14 | -------------------------------------------------------------------------------- /docs/src/main/asciidoc/spring-cloud-sleuth.htmlsingleadoc: -------------------------------------------------------------------------------- 1 | [[spring-cloud-sleuth-reference-documentation]] 2 | = Spring Cloud Sleuth Reference Documentation 3 | Adrian Cole, Spencer Gibb, Marcin Grzejszczak, Dave Syer, Jay Bryant 4 | 5 | == !!!! IMPORTANT !!!! 6 | 7 | Spring Cloud Sleuth's last minor version is 3.1. You can check the https://github.com/spring-cloud/spring-cloud-sleuth/tree/3.1.x[3.1.x] branch for the latest commits. 8 | 9 | WARNING: Spring Cloud Sleuth will not work with Spring Boot 3.x onward. The last major version of Spring Boot that Sleuth will support is 2.x. 10 | 11 | The core of this project got moved to https://micrometer.io/docs/tracing[Micrometer Tracing] project and the instrumentations will be moved to https://micrometer.io/[Micrometer] and all respective projects (no longer all instrumentations will be done in a single repository. 12 | 13 | You can check the https://github.com/micrometer-metrics/tracing/wiki/Spring-Cloud-Sleuth-3.1-Migration-Guide[Micrometer Tracing migration guide] to learn how to migrate from Spring Cloud Sleuth to Micrometer Tracing. 14 | 15 | :docinfo: shared 16 | include::_attributes.adoc[] 17 | 18 | include::legal.adoc[leveloffset=+1] 19 | include::getting-started.adoc[leveloffset=+1] 20 | include::using.adoc[leveloffset=+1] 21 | include::project-features.adoc[leveloffset=+1] 22 | include::howto.adoc[leveloffset=+1] 23 | include::integrations.adoc[leveloffset=+1] 24 | include::appendix.adoc[leveloffset=+1] 25 | -------------------------------------------------------------------------------- /docs/src/main/asciidoc/spring-cloud-sleuth.pdfadoc: -------------------------------------------------------------------------------- 1 | [[spring-cloud-sleuth-reference-documentation]] 2 | = Spring Cloud Sleuth Reference Documentation 3 | Adrian Cole, Spencer Gibb, Marcin Grzejszczak, Dave Syer, Jay Bryant 4 | 5 | == !!!! IMPORTANT !!!! 6 | 7 | Spring Cloud Sleuth's last minor version is 3.1. You can check the https://github.com/spring-cloud/spring-cloud-sleuth/tree/3.1.x[3.1.x] branch for the latest commits. 8 | 9 | WARNING: Spring Cloud Sleuth will not work with Spring Boot 3.x onward. The last major version of Spring Boot that Sleuth will support is 2.x. 10 | 11 | The core of this project got moved to https://micrometer.io/docs/tracing[Micrometer Tracing] project and the instrumentations will be moved to https://micrometer.io/[Micrometer] and all respective projects (no longer all instrumentations will be done in a single repository. 12 | 13 | You can check the https://github.com/micrometer-metrics/tracing/wiki/Spring-Cloud-Sleuth-3.1-Migration-Guide[Micrometer Tracing migration guide] to learn how to migrate from Spring Cloud Sleuth to Micrometer Tracing. 14 | 15 | include::_attributes.adoc[] 16 | 17 | include::legal.adoc[leveloffset=+1] 18 | include::getting-started.adoc[leveloffset=+1] 19 | include::using.adoc[leveloffset=+1] 20 | include::project-features.adoc[leveloffset=+1] 21 | include::howto.adoc[leveloffset=+1] 22 | include::integrations.adoc[leveloffset=+1] 23 | include::appendix.adoc[leveloffset=+1] 24 | -------------------------------------------------------------------------------- /scripts/runAcceptanceTests.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -o errexit 4 | 5 | mkdir -p target 6 | 7 | BRANCH_NAME="2021.0.x" 8 | SCRIPT_URL="https://raw.githubusercontent.com/spring-cloud-samples/brewery/${BRANCH_NAME}/runAcceptanceTests.sh" 9 | AT_WHAT_TO_TEST="SLEUTH" 10 | 11 | cd target 12 | 13 | curl "${SCRIPT_URL}" --output runAcceptanceTests.sh 14 | 15 | chmod +x runAcceptanceTests.sh 16 | 17 | echo "Killing all running apps" 18 | ./runAcceptanceTests.sh -t "${AT_WHAT_TO_TEST}" -n -br "${BRANCH_NAME}" 19 | 20 | ./runAcceptanceTests.sh --whattotest "${AT_WHAT_TO_TEST}" --killattheend -br "${BRANCH_NAME}" 21 | -------------------------------------------------------------------------------- /scripts/runAcceptanceTestsOfDocApps.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -o errexit 4 | 5 | mkdir -p target 6 | 7 | REPO_URL="https://github.com/spring-cloud-samples/sleuth-documentation-apps.git" 8 | BRANCH_NAME="main" 9 | 10 | pushd target 11 | git clone "${REPO_URL}" 12 | 13 | pushd sleuth-documentation-apps 14 | ./scripts/runAcceptanceTests.sh 15 | 16 | popd 17 | popd 18 | -------------------------------------------------------------------------------- /scripts/runJmeterBenchmarks.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | echo "Killing the remaining apps - if something went wrong previously" 4 | pkill -f SleuthBenchmarkingSpringApp || echo "No apps to kill" 5 | 6 | echo "Running JMeter Benchmarks" 7 | ./mvnw clean verify --projects benchmarks --also-make -Pbenchmarks,jmeter 8 | echo "Killing the remaining apps - if something went wrong after the tests" 9 | pkill -f SleuthBenchmarkingSpringApp || echo "No apps to kill" 10 | -------------------------------------------------------------------------------- /scripts/runJmhBenchmarks.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | echo "Running JMH Benchmarks" 4 | ROOT="$(pwd)" 5 | JMH_RESULT_FILE_PARENT="${ROOT}/target" 6 | mkdir -p "${JMH_RESULT_FILE_PARENT}" 7 | JMH_RESULT_FILE="${JMH_RESULT_FILE_PARENT}/jmh-result.csv" 8 | echo "Will produce results under [${JMH_RESULT_FILE}]" 9 | ./mvnw clean install -Pbenchmarks -pl benchmarks --also-make -DskipTests && ./mvnw verify -DpublishTo=csv:"${JMH_RESULT_FILE}" -Djmh.mbr.report.publishTo=csv:"${JMH_RESULT_FILE}" -pl benchmarks -Pbenchmarks 10 | 11 | # java -Djmh.ignoreLock=true -jar benchmarks/target/benchmarks.jar org.springframework.cloud.sleuth.benchmarks.jmh.* -rf csv -rff jmh-result.csv | tee target/benchmarks.log 12 | -------------------------------------------------------------------------------- /spring-cloud-sleuth-api/src/main/java/org/springframework/cloud/sleuth/SpanCustomizer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.cloud.sleuth; 18 | 19 | /** 20 | * Allows to customize the current span in scope. 21 | * 22 | * @author OpenZipkin Brave Authors 23 | * @author Marcin Grzejszczak 24 | * @since 3.0.0 25 | */ 26 | public interface SpanCustomizer { 27 | 28 | /** 29 | * Sets a name on a span. 30 | * @param name name to set on a span 31 | * @return this, for chaining 32 | */ 33 | SpanCustomizer name(String name); 34 | 35 | /** 36 | * Sets a tag on a span. 37 | * @param key tag key 38 | * @param value tag value 39 | * @return this, for chaining 40 | */ 41 | SpanCustomizer tag(String key, String value); 42 | 43 | /** 44 | * Sets an event on a span. 45 | * @param value event name 46 | * @return this, for chaining 47 | */ 48 | SpanCustomizer event(String value); 49 | 50 | } 51 | -------------------------------------------------------------------------------- /spring-cloud-sleuth-api/src/main/java/org/springframework/cloud/sleuth/SpanNamer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.cloud.sleuth; 18 | 19 | /** 20 | * Describes how for a given object a span should be named. In the vast majority of cases 21 | * a name should be provided explicitly. In case of instrumentation where the name has to 22 | * be resolved at runtime this interface will provide the name of the span. 23 | * 24 | * @author Marcin Grzejszczak 25 | * @since 1.0.0 26 | */ 27 | public interface SpanNamer { 28 | 29 | /** 30 | * Retrieves the span name for the given object. 31 | * @param object - object for which span name should be picked 32 | * @param defaultValue - the default valued to be returned if span name can't be 33 | * calculated 34 | * @return span name 35 | */ 36 | String name(Object object, String defaultValue); 37 | 38 | } 39 | -------------------------------------------------------------------------------- /spring-cloud-sleuth-api/src/main/java/org/springframework/cloud/sleuth/Taggable.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.cloud.sleuth; 18 | 19 | /** 20 | * 21 | * Describes the behaviour of an object that can be tagged. 22 | * 23 | * @author Marcin Grzejszczak 24 | * @since 3.0.3 25 | */ 26 | public interface Taggable { 27 | 28 | /** 29 | * Sets a tag. 30 | * @param key tag key 31 | * @param value tag value 32 | * @return this, for chaining 33 | */ 34 | Taggable tag(String key, String value); 35 | 36 | } 37 | -------------------------------------------------------------------------------- /spring-cloud-sleuth-api/src/main/java/org/springframework/cloud/sleuth/annotation/NewSpanParser.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.cloud.sleuth.annotation; 18 | 19 | import org.aopalliance.intercept.MethodInvocation; 20 | 21 | import org.springframework.cloud.sleuth.Span; 22 | 23 | /** 24 | * Parses data for a span created via a {@link NewSpan} annotation. 25 | * 26 | * @author Adrian Cole 27 | * @since 2.0.0 28 | */ 29 | public interface NewSpanParser { 30 | 31 | /** 32 | * Override to control the name and tags on an annotation-based span. 33 | * @param methodInvocation method invocation annotated with new span 34 | * @param newSpan meta data of the new span 35 | * @param span span to customize 36 | */ 37 | void parse(MethodInvocation methodInvocation, NewSpan newSpan, Span span); 38 | 39 | } 40 | -------------------------------------------------------------------------------- /spring-cloud-sleuth-api/src/main/java/org/springframework/cloud/sleuth/annotation/NoOpTagValueResolver.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.cloud.sleuth.annotation; 18 | 19 | /** 20 | * Does nothing. 21 | * 22 | * @author Marcin Grzejszczak 23 | * @since 1.2.0 24 | */ 25 | public class NoOpTagValueResolver implements TagValueResolver { 26 | 27 | @Override 28 | public String resolve(Object parameter) { 29 | return null; 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /spring-cloud-sleuth-api/src/main/java/org/springframework/cloud/sleuth/annotation/SleuthMethodInvocationProcessor.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.cloud.sleuth.annotation; 18 | 19 | import org.aopalliance.intercept.MethodInvocation; 20 | 21 | /** 22 | * Contract for processing Sleuth annotations. 23 | * 24 | * @author Marcin Grzejszczak 25 | * @since 2.1.0 26 | */ 27 | public interface SleuthMethodInvocationProcessor { 28 | 29 | /** 30 | * Executes a given Sleuth annotated method. 31 | * @param invocation method invocation 32 | * @param newSpan annotation 33 | * @param continueSpan annotation 34 | * @return executed method result 35 | * @throws Throwable exception upon running a method 36 | */ 37 | Object process(MethodInvocation invocation, NewSpan newSpan, ContinueSpan continueSpan) throws Throwable; 38 | 39 | } 40 | -------------------------------------------------------------------------------- /spring-cloud-sleuth-api/src/main/java/org/springframework/cloud/sleuth/annotation/TagValueExpressionResolver.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.cloud.sleuth.annotation; 18 | 19 | /** 20 | * Resolves the tag value for the given parameter and the provided expression. 21 | * 22 | * @author Marcin Grzejszczak 23 | * @since 1.2.0 24 | */ 25 | public interface TagValueExpressionResolver { 26 | 27 | /** 28 | * Returns the tag value for the given parameter and the provided expression. 29 | * @param expression - the expression coming from {@link SpanTag#expression()} 30 | * @param parameter - parameter annotated with {@link SpanTag} 31 | * @return the value of the tag 32 | */ 33 | String resolve(String expression, Object parameter); 34 | 35 | } 36 | -------------------------------------------------------------------------------- /spring-cloud-sleuth-api/src/main/java/org/springframework/cloud/sleuth/annotation/TagValueResolver.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.cloud.sleuth.annotation; 18 | 19 | /** 20 | * Resolves the tag value for the given parameter. 21 | * 22 | * @author Christian Schwerdtfeger 23 | * @since 1.2.0 24 | */ 25 | public interface TagValueResolver { 26 | 27 | /** 28 | * Returns the tag value for the given parameter. 29 | * @param parameter - parameter annotated with {@link SpanTag} 30 | * @return the value of the tag 31 | */ 32 | String resolve(Object parameter); 33 | 34 | } 35 | -------------------------------------------------------------------------------- /spring-cloud-sleuth-api/src/main/java/org/springframework/cloud/sleuth/docs/EventValue.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.cloud.sleuth.docs; 18 | 19 | /** 20 | * Event value representing a notable event in time. 21 | * 22 | * @author Marcin Grzejszczak 23 | * @since 3.1.0 24 | */ 25 | public interface EventValue { 26 | 27 | /** 28 | * @return event value 29 | */ 30 | String getValue(); 31 | 32 | } 33 | -------------------------------------------------------------------------------- /spring-cloud-sleuth-api/src/main/java/org/springframework/cloud/sleuth/docs/TagKey.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.cloud.sleuth.docs; 18 | 19 | import java.util.Arrays; 20 | 21 | /** 22 | * Represents a tag key. 23 | * 24 | * @author Marcin Grzejszczak 25 | * @since 3.1.0 26 | */ 27 | public interface TagKey { 28 | 29 | /** 30 | * @return tag key 31 | */ 32 | String getKey(); 33 | 34 | /** 35 | * Merges arrays of tags. 36 | * @param tags array of tags 37 | * @return a merged array of tags 38 | */ 39 | static TagKey[] merge(TagKey[]... tags) { 40 | return Arrays.stream(tags).flatMap(Arrays::stream).toArray(TagKey[]::new); 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /spring-cloud-sleuth-api/src/main/java/org/springframework/cloud/sleuth/exporter/SpanFilter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.cloud.sleuth.exporter; 18 | 19 | /** 20 | * An interface that allows to filter whether a given reported span should be exported or 21 | * not. 22 | * 23 | * @author Marcin Grzejszczak 24 | * @since 3.0.0 25 | */ 26 | public interface SpanFilter { 27 | 28 | /** 29 | * Called to export sampled {@code Span}s. 30 | * @param span the collection of sampled Spans to be exported. 31 | * @return whether should export spans 32 | */ 33 | boolean isExportable(FinishedSpan span); 34 | 35 | } 36 | -------------------------------------------------------------------------------- /spring-cloud-sleuth-api/src/main/java/org/springframework/cloud/sleuth/exporter/SpanReporter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.cloud.sleuth.exporter; 18 | 19 | /** 20 | * An interface that allows to process spans after they got finished. 21 | * 22 | * @author Marcin Grzejszczak 23 | * @since 3.1.0 24 | */ 25 | public interface SpanReporter { 26 | 27 | /** 28 | * Reports the finished span. 29 | * @param span a span that was ended and is ready to be reported. 30 | */ 31 | void report(FinishedSpan span); 32 | 33 | } 34 | -------------------------------------------------------------------------------- /spring-cloud-sleuth-api/src/main/java/org/springframework/cloud/sleuth/http/HttpClientRequest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.cloud.sleuth.http; 18 | 19 | import org.springframework.cloud.sleuth.Span; 20 | 21 | /** 22 | * This API is taken from OpenZipkin Brave. 23 | * 24 | * Abstract request type used for parsing and sampling. Represents an HTTP Client request. 25 | * 26 | * @author OpenZipkin Brave Authors 27 | * @author Marcin Grzejszczak 28 | * @since 3.0.0 29 | */ 30 | public interface HttpClientRequest extends HttpRequest { 31 | 32 | @Override 33 | default Span.Kind spanKind() { 34 | return Span.Kind.CLIENT; 35 | } 36 | 37 | /** 38 | * @param name header name 39 | * @param value header value 40 | */ 41 | void header(String name, String value); 42 | 43 | } 44 | -------------------------------------------------------------------------------- /spring-cloud-sleuth-api/src/main/java/org/springframework/cloud/sleuth/http/HttpClientResponse.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.cloud.sleuth.http; 18 | 19 | import org.springframework.cloud.sleuth.Span; 20 | import org.springframework.lang.Nullable; 21 | 22 | /** 23 | * This API is taken from OpenZipkin Brave. 24 | * 25 | * Abstract response type used for parsing and sampling. Represents an HTTP Client 26 | * response. 27 | * 28 | * @author OpenZipkin Brave Authors 29 | * @author Marcin Grzejszczak 30 | * @since 3.0.0 31 | */ 32 | public interface HttpClientResponse extends HttpResponse { 33 | 34 | @Override 35 | default Span.Kind spanKind() { 36 | return Span.Kind.CLIENT; 37 | } 38 | 39 | @Nullable 40 | default HttpClientRequest request() { 41 | return null; 42 | } 43 | 44 | @Override 45 | default Throwable error() { 46 | return null; 47 | } 48 | 49 | } 50 | -------------------------------------------------------------------------------- /spring-cloud-sleuth-api/src/main/java/org/springframework/cloud/sleuth/http/HttpRequestParser.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.cloud.sleuth.http; 18 | 19 | import org.springframework.cloud.sleuth.SpanCustomizer; 20 | import org.springframework.cloud.sleuth.TraceContext; 21 | 22 | /** 23 | * This API is taken from OpenZipkin Brave. 24 | * 25 | * Use this to control the request data recorded. 26 | * 27 | * @author OpenZipkin Brave Authors 28 | * @author Marcin Grzejszczak 29 | * @since 3.0.0 30 | */ 31 | public interface HttpRequestParser { 32 | 33 | /** 34 | * Implement to choose what data from the http request are parsed into the span 35 | * representing it. 36 | * @param request current request 37 | * @param context corresponding trace context 38 | * @param span customizer for the current span 39 | */ 40 | void parse(HttpRequest request, TraceContext context, SpanCustomizer span); 41 | 42 | } 43 | -------------------------------------------------------------------------------- /spring-cloud-sleuth-api/src/main/java/org/springframework/cloud/sleuth/http/HttpResponseParser.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.cloud.sleuth.http; 18 | 19 | import org.springframework.cloud.sleuth.SpanCustomizer; 20 | import org.springframework.cloud.sleuth.TraceContext; 21 | 22 | /** 23 | * This API is taken from OpenZipkin Brave. 24 | * 25 | * Use this to control the response data recorded. 26 | * 27 | * @author OpenZipkin Brave Authors 28 | * @author Marcin Grzejszczak 29 | * @since 3.0.0 30 | */ 31 | public interface HttpResponseParser { 32 | 33 | /** 34 | * Implement to choose what data from the http response are parsed into the span 35 | * representing it. 36 | * @param response current response 37 | * @param context corresponding trace context 38 | * @param span customizer for the current span 39 | */ 40 | void parse(HttpResponse response, TraceContext context, SpanCustomizer span); 41 | 42 | } 43 | -------------------------------------------------------------------------------- /spring-cloud-sleuth-api/src/main/java/org/springframework/cloud/sleuth/http/HttpServerResponse.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.cloud.sleuth.http; 18 | 19 | import org.springframework.cloud.sleuth.Span; 20 | import org.springframework.lang.Nullable; 21 | 22 | /** 23 | * This API is taken from OpenZipkin Brave. 24 | * 25 | * Abstract response type used for parsing and sampling. Represents an HTTP Server 26 | * response. 27 | * 28 | * @author OpenZipkin Brave Authors 29 | * @author Marcin Grzejszczak 30 | * @since 3.0.0 31 | */ 32 | public interface HttpServerResponse extends HttpResponse { 33 | 34 | @Override 35 | default Span.Kind spanKind() { 36 | return Span.Kind.SERVER; 37 | } 38 | 39 | @Nullable 40 | default HttpServerRequest request() { 41 | return null; 42 | } 43 | 44 | @Override 45 | default Throwable error() { 46 | return null; 47 | } 48 | 49 | } 50 | -------------------------------------------------------------------------------- /spring-cloud-sleuth-api/src/main/java/org/springframework/cloud/sleuth/http/Request.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.cloud.sleuth.http; 18 | 19 | import java.util.Collection; 20 | 21 | import org.springframework.cloud.sleuth.Span; 22 | 23 | /** 24 | * This API is taken from OpenZipkin Brave. 25 | * 26 | * Abstract request type used for parsing and sampling. 27 | * 28 | * @author OpenZipkin Brave Authors 29 | * @author Marcin Grzejszczak 30 | * @since 3.0.0 31 | */ 32 | public interface Request { 33 | 34 | /** 35 | * @return list of header names. 36 | */ 37 | Collection headerNames(); 38 | 39 | /** 40 | * @return The remote {@link Span.Kind} describing the direction and type of the 41 | * request. 42 | */ 43 | Span.Kind spanKind(); 44 | 45 | /** 46 | * @return the underlying request object or {@code null} if there is none. 47 | */ 48 | Object unwrap(); 49 | 50 | } 51 | -------------------------------------------------------------------------------- /spring-cloud-sleuth-api/src/test/java/org/springframework/cloud/sleuth/annotation/NoOpTagValueResolverTests.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.cloud.sleuth.annotation; 18 | 19 | import org.junit.jupiter.api.Test; 20 | 21 | import static org.assertj.core.api.BDDAssertions.then; 22 | 23 | /** 24 | * @author Marcin Grzejszczak 25 | */ 26 | public class NoOpTagValueResolverTests { 27 | 28 | @Test 29 | public void should_return_null() throws Exception { 30 | then(new NoOpTagValueResolver().resolve("")).isNull(); 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /spring-cloud-sleuth-api/src/test/resources/META-INF/spring.factories: -------------------------------------------------------------------------------- 1 | # Auto Configuration 2 | org.springframework.boot.autoconfigure.EnableAutoConfiguration=\ 3 | org.springframework.cloud.sleuth.autoconfig.TraceNoOpAutoConfiguration -------------------------------------------------------------------------------- /spring-cloud-sleuth-api/src/test/resources/application.yml: -------------------------------------------------------------------------------- 1 | logging.level.org.springframework.cloud: DEBUG 2 | logging.level.com.netflix.discovery.InstanceInfoReplicator: ERROR 3 | logging.level.org.springframework.cloud.sleuth.instrument.web.client.feign: TRACE 4 | 5 | spring.autoconfigure.exclude: org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration, org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration, org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration, org.springframework.boot.autoconfigure.data.web.SpringDataWebAutoConfiguration, org.springframework.cloud.gateway.config.GatewayAutoConfiguration, org.springframework.cloud.gateway.config.GatewayClassPathWarningAutoConfiguration, org.springframework.cloud.gateway.config.GatewayMetricsAutoConfiguration, org.springframework.boot.actuate.autoconfigure.security.servlet.ManagementWebSecurityAutoConfiguration 6 | -------------------------------------------------------------------------------- /spring-cloud-sleuth-autoconfigure/src/main/java/org/springframework/cloud/sleuth/autoconfig/SingleSkipPattern.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.cloud.sleuth.autoconfig; 18 | 19 | import java.util.Optional; 20 | import java.util.regex.Pattern; 21 | 22 | /** 23 | * Provides a URL {@link Pattern} for spans that should be not sampled. The default 24 | * implementation will harvest all {@link SingleSkipPattern}s and combine them in a single 25 | * pattern 26 | * 27 | * @author Marcin Grzejszczak 28 | * @since 2.1.0 29 | */ 30 | public interface SingleSkipPattern { 31 | 32 | /** 33 | * @return optional pattern to skip 34 | */ 35 | Optional skipPattern(); 36 | 37 | } 38 | -------------------------------------------------------------------------------- /spring-cloud-sleuth-autoconfigure/src/main/java/org/springframework/cloud/sleuth/autoconfig/SleuthOpentracingProperties.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.cloud.sleuth.autoconfig; 18 | 19 | import org.springframework.boot.context.properties.ConfigurationProperties; 20 | 21 | /** 22 | * Sleuth OpenTracing settings. 23 | * 24 | * @author Marcin Grzejszczak 25 | * @since 2.0.0 26 | */ 27 | @ConfigurationProperties("spring.sleuth.opentracing") 28 | public class SleuthOpentracingProperties { 29 | 30 | /** 31 | * Enables OpenTracing support. 32 | */ 33 | private boolean enabled = true; 34 | 35 | public boolean isEnabled() { 36 | return this.enabled; 37 | } 38 | 39 | public void setEnabled(boolean enabled) { 40 | this.enabled = enabled; 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /spring-cloud-sleuth-autoconfigure/src/main/java/org/springframework/cloud/sleuth/autoconfig/actuate/FinishedSpanWriter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.cloud.sleuth.autoconfig.actuate; 18 | 19 | import java.util.List; 20 | 21 | import org.springframework.cloud.sleuth.exporter.FinishedSpan; 22 | 23 | /** 24 | * Writes finished spans in a provided format. 25 | * 26 | * @author Marcin Grzejszczak 27 | * @since 3.1.0 28 | */ 29 | public interface FinishedSpanWriter { 30 | 31 | /** 32 | * Writes the spans in a given format to String. 33 | * @param format format in which spans should be stored 34 | * @param spans spans to store 35 | * @return string representation of spans or {@code null} if {@link TextOutputFormat} 36 | * is not supported. 37 | */ 38 | T write(TextOutputFormat format, List spans); 39 | 40 | } 41 | -------------------------------------------------------------------------------- /spring-cloud-sleuth-autoconfigure/src/main/java/org/springframework/cloud/sleuth/autoconfig/actuate/SleuthActuatorProperties.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.cloud.sleuth.autoconfig.actuate; 18 | 19 | import org.springframework.boot.context.properties.ConfigurationProperties; 20 | 21 | /** 22 | * Settings for Sleuth actuator. 23 | * 24 | * @author Marcin Grzejszczak 25 | * @since 3.1.0 26 | */ 27 | @ConfigurationProperties(prefix = "management.endpoint.traces") 28 | public class SleuthActuatorProperties { 29 | 30 | /** 31 | * Max capacity of the span queue. 32 | */ 33 | private int capacity = 10_000; 34 | 35 | public int getCapacity() { 36 | return this.capacity; 37 | } 38 | 39 | public void setCapacity(int capacity) { 40 | this.capacity = capacity; 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /spring-cloud-sleuth-autoconfigure/src/main/java/org/springframework/cloud/sleuth/autoconfig/instrument/circuitbreaker/SleuthCircuitBreakerProperties.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.cloud.sleuth.autoconfig.instrument.circuitbreaker; 18 | 19 | import org.springframework.boot.context.properties.ConfigurationProperties; 20 | 21 | /** 22 | * Sleuth Circuit Breaker settings. 23 | * 24 | * @author Marcin Grzejszczak 25 | * @since 2.2.1 26 | */ 27 | @ConfigurationProperties("spring.sleuth.circuitbreaker") 28 | public class SleuthCircuitBreakerProperties { 29 | 30 | /** 31 | * Enable Spring Cloud CircuitBreaker instrumentation. 32 | */ 33 | private boolean enabled = true; 34 | 35 | public boolean isEnabled() { 36 | return this.enabled; 37 | } 38 | 39 | public void setEnabled(boolean enabled) { 40 | this.enabled = enabled; 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /spring-cloud-sleuth-autoconfigure/src/main/java/org/springframework/cloud/sleuth/autoconfig/instrument/kafka/SpringKafkaConsumerPostProcessor.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.cloud.sleuth.autoconfig.instrument.kafka; 18 | 19 | import org.apache.kafka.clients.consumer.Consumer; 20 | 21 | import org.springframework.beans.factory.BeanFactory; 22 | import org.springframework.cloud.sleuth.instrument.kafka.TracingKafkaConsumer; 23 | import org.springframework.kafka.core.ConsumerPostProcessor; 24 | 25 | class SpringKafkaConsumerPostProcessor implements ConsumerPostProcessor { 26 | 27 | private final BeanFactory beanFactory; 28 | 29 | SpringKafkaConsumerPostProcessor(BeanFactory beanFactory) { 30 | this.beanFactory = beanFactory; 31 | } 32 | 33 | @Override 34 | public Consumer apply(Consumer kvConsumer) { 35 | return new TracingKafkaConsumer<>(kvConsumer, beanFactory); 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /spring-cloud-sleuth-autoconfigure/src/main/java/org/springframework/cloud/sleuth/autoconfig/instrument/kafka/SpringKafkaProducerPostProcessor.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.cloud.sleuth.autoconfig.instrument.kafka; 18 | 19 | import org.apache.kafka.clients.producer.Producer; 20 | 21 | import org.springframework.beans.factory.BeanFactory; 22 | import org.springframework.cloud.sleuth.instrument.kafka.TracingKafkaProducer; 23 | import org.springframework.kafka.core.ProducerPostProcessor; 24 | 25 | class SpringKafkaProducerPostProcessor implements ProducerPostProcessor { 26 | 27 | private final BeanFactory beanFactory; 28 | 29 | SpringKafkaProducerPostProcessor(BeanFactory beanFactory) { 30 | this.beanFactory = beanFactory; 31 | } 32 | 33 | @Override 34 | public Producer apply(Producer kvProducer) { 35 | return new TracingKafkaProducer<>(kvProducer, beanFactory); 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /spring-cloud-sleuth-autoconfigure/src/main/java/org/springframework/cloud/sleuth/autoconfig/instrument/rsocket/SleuthRSocketProperties.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.cloud.sleuth.autoconfig.instrument.rsocket; 18 | 19 | import org.springframework.boot.context.properties.ConfigurationProperties; 20 | 21 | /** 22 | * Sleuth RSocket settings. 23 | * 24 | * @author Oleh Dokuka 25 | * @since 3.1.0 26 | */ 27 | @ConfigurationProperties("spring.sleuth.rsocket") 28 | public class SleuthRSocketProperties { 29 | 30 | /** 31 | * When true enables instrumentation for rsocket. 32 | */ 33 | private boolean enabled = true; 34 | 35 | public boolean isEnabled() { 36 | return this.enabled; 37 | } 38 | 39 | public void setEnabled(boolean enabled) { 40 | this.enabled = enabled; 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /spring-cloud-sleuth-autoconfigure/src/main/java/org/springframework/cloud/sleuth/autoconfig/instrument/web/ConditionalOnSleuthHttp.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.cloud.sleuth.autoconfig.instrument.web; 18 | 19 | import java.lang.annotation.Documented; 20 | import java.lang.annotation.ElementType; 21 | import java.lang.annotation.Retention; 22 | import java.lang.annotation.RetentionPolicy; 23 | import java.lang.annotation.Target; 24 | 25 | import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; 26 | 27 | /** 28 | * Helper annotation to enable Sleuth web. 29 | * 30 | * @author Marcin Grzejszczak 31 | * @since 3.0.0 32 | */ 33 | @Retention(RetentionPolicy.RUNTIME) 34 | @Target({ ElementType.TYPE, ElementType.METHOD }) 35 | @Documented 36 | @ConditionalOnProperty(value = "spring.sleuth.http.enabled", matchIfMissing = true) 37 | @ConditionalOnSleuthWeb 38 | public @interface ConditionalOnSleuthHttp { 39 | 40 | } 41 | -------------------------------------------------------------------------------- /spring-cloud-sleuth-autoconfigure/src/main/java/org/springframework/cloud/sleuth/autoconfig/instrument/web/ConditionalOnSleuthWeb.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.cloud.sleuth.autoconfig.instrument.web; 18 | 19 | import java.lang.annotation.Documented; 20 | import java.lang.annotation.ElementType; 21 | import java.lang.annotation.Retention; 22 | import java.lang.annotation.RetentionPolicy; 23 | import java.lang.annotation.Target; 24 | 25 | import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; 26 | 27 | /** 28 | * Helper annotation to enable Sleuth web. 29 | * 30 | * @author Marcin Grzejszczak 31 | * @since 3.0.0 32 | */ 33 | @Retention(RetentionPolicy.RUNTIME) 34 | @Target({ ElementType.TYPE, ElementType.METHOD }) 35 | @Documented 36 | @ConditionalOnProperty(value = "spring.sleuth.web.enabled", matchIfMissing = true) 37 | public @interface ConditionalOnSleuthWeb { 38 | 39 | } 40 | -------------------------------------------------------------------------------- /spring-cloud-sleuth-autoconfigure/src/main/java/org/springframework/cloud/sleuth/autoconfig/instrument/web/SleuthHttpProperties.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.cloud.sleuth.autoconfig.instrument.web; 18 | 19 | import org.springframework.boot.context.properties.ConfigurationProperties; 20 | 21 | /** 22 | * Sleuth HTTP settings. 23 | * 24 | * @author Marcin Grzejszczak 25 | * @since 2.0.0 26 | */ 27 | @ConfigurationProperties("spring.sleuth.http") 28 | public class SleuthHttpProperties { 29 | 30 | /** 31 | * Enables HTTP support. 32 | */ 33 | private boolean enabled = true; 34 | 35 | public boolean isEnabled() { 36 | return this.enabled; 37 | } 38 | 39 | public void setEnabled(boolean enabled) { 40 | this.enabled = enabled; 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /spring-cloud-sleuth-autoconfigure/src/main/java/org/springframework/cloud/sleuth/autoconfig/instrument/web/client/feign/SleuthFeignProperties.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.cloud.sleuth.autoconfig.instrument.web.client.feign; 18 | 19 | import org.springframework.boot.context.properties.ConfigurationProperties; 20 | 21 | /** 22 | * Configuration properties for Feign. 23 | * 24 | * @author Marcin Grzejszczak 25 | * @since 2.0.2 26 | */ 27 | @ConfigurationProperties("spring.sleuth.feign") 28 | public class SleuthFeignProperties { 29 | 30 | /** 31 | * When true enables instrumentation for feign. 32 | */ 33 | private boolean enabled = true; 34 | 35 | public boolean isEnabled() { 36 | return this.enabled; 37 | } 38 | 39 | public void setEnabled(boolean enabled) { 40 | this.enabled = enabled; 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /spring-cloud-sleuth-autoconfigure/src/test/java/org/springframework/cloud/sleuth/DisableSecurity.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.cloud.sleuth; 18 | 19 | import java.lang.annotation.Documented; 20 | import java.lang.annotation.ElementType; 21 | import java.lang.annotation.Retention; 22 | import java.lang.annotation.RetentionPolicy; 23 | import java.lang.annotation.Target; 24 | 25 | import org.springframework.context.annotation.Import; 26 | 27 | /** 28 | * @author Marcin Grzejszczak 29 | */ 30 | @Import(PermitAllServletConfiguration.class) 31 | @Target({ ElementType.TYPE }) 32 | @Retention(RetentionPolicy.RUNTIME) 33 | @Documented 34 | public @interface DisableSecurity { 35 | 36 | } 37 | -------------------------------------------------------------------------------- /spring-cloud-sleuth-autoconfigure/src/test/java/org/springframework/cloud/sleuth/DisableWebFluxSecurity.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.cloud.sleuth; 18 | 19 | import java.lang.annotation.Documented; 20 | import java.lang.annotation.ElementType; 21 | import java.lang.annotation.Retention; 22 | import java.lang.annotation.RetentionPolicy; 23 | import java.lang.annotation.Target; 24 | 25 | import org.springframework.context.annotation.Import; 26 | 27 | /** 28 | * @author Marcin Grzejszczak 29 | */ 30 | @Import(PermitAllWebFluxSecurityConfiguration.class) 31 | @Target({ ElementType.TYPE }) 32 | @Retention(RetentionPolicy.RUNTIME) 33 | @Documented 34 | public @interface DisableWebFluxSecurity { 35 | 36 | } 37 | -------------------------------------------------------------------------------- /spring-cloud-sleuth-autoconfigure/src/test/java/org/springframework/cloud/sleuth/PermitAllServletConfiguration.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.cloud.sleuth; 18 | 19 | import org.springframework.context.annotation.Configuration; 20 | import org.springframework.core.annotation.Order; 21 | import org.springframework.security.config.annotation.web.builders.HttpSecurity; 22 | import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; 23 | import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; 24 | 25 | @Configuration(proxyBeanMethods = false) 26 | @EnableWebSecurity 27 | @Order(99) 28 | class PermitAllServletConfiguration extends WebSecurityConfigurerAdapter { 29 | 30 | @Override 31 | protected void configure(HttpSecurity http) throws Exception { 32 | http.authorizeRequests().antMatchers("/*").permitAll(); 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /spring-cloud-sleuth-autoconfigure/src/test/java/org/springframework/cloud/sleuth/PermitAllWebFluxSecurityConfiguration.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.cloud.sleuth; 18 | 19 | import org.springframework.context.annotation.Bean; 20 | import org.springframework.context.annotation.Configuration; 21 | import org.springframework.security.config.web.server.ServerHttpSecurity; 22 | import org.springframework.security.web.server.SecurityWebFilterChain; 23 | 24 | @Configuration(proxyBeanMethods = false) 25 | class PermitAllWebFluxSecurityConfiguration { 26 | 27 | @Bean 28 | SecurityWebFilterChain springWebFilterChain(ServerHttpSecurity http) throws Exception { 29 | return http.authorizeExchange().anyExchange().permitAll().and().csrf().disable().build(); 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /spring-cloud-sleuth-autoconfigure/src/test/java/org/springframework/cloud/sleuth/autoconfig/NoOpHttpServerHandler.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.cloud.sleuth.autoconfig; 18 | 19 | import org.springframework.cloud.sleuth.Span; 20 | import org.springframework.cloud.sleuth.http.HttpServerHandler; 21 | import org.springframework.cloud.sleuth.http.HttpServerRequest; 22 | import org.springframework.cloud.sleuth.http.HttpServerResponse; 23 | 24 | /** 25 | * A noop implementation. Does nothing. 26 | * 27 | * @author Marcin Grzejszczak 28 | * @since 3.0.0 29 | */ 30 | class NoOpHttpServerHandler implements HttpServerHandler { 31 | 32 | @Override 33 | public Span handleReceive(HttpServerRequest request) { 34 | return new NoOpSpan(); 35 | } 36 | 37 | @Override 38 | public void handleSend(HttpServerResponse response, Span span) { 39 | 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /spring-cloud-sleuth-autoconfigure/src/test/java/org/springframework/cloud/sleuth/autoconfig/NoOpSpanCustomizer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.cloud.sleuth.autoconfig; 18 | 19 | import org.springframework.cloud.sleuth.SpanCustomizer; 20 | 21 | /** 22 | * A noop implementation. Does nothing. 23 | * 24 | * @author Marcin Grzejszczak 25 | * @since 3.0.0 26 | */ 27 | class NoOpSpanCustomizer implements SpanCustomizer { 28 | 29 | @Override 30 | public SpanCustomizer name(String name) { 31 | return this; 32 | } 33 | 34 | @Override 35 | public SpanCustomizer tag(String key, String value) { 36 | return this; 37 | } 38 | 39 | @Override 40 | public SpanCustomizer event(String value) { 41 | return this; 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /spring-cloud-sleuth-autoconfigure/src/test/java/org/springframework/cloud/sleuth/autoconfig/NoOpSpanInScope.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.cloud.sleuth.autoconfig; 18 | 19 | import org.springframework.cloud.sleuth.Tracer; 20 | 21 | /** 22 | * A noop implementation. Does nothing. 23 | * 24 | * @author Marcin Grzejszczak 25 | * @since 3.0.0 26 | */ 27 | class NoOpSpanInScope implements Tracer.SpanInScope { 28 | 29 | @Override 30 | public void close() { 31 | 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /spring-cloud-sleuth-autoconfigure/src/test/java/org/springframework/cloud/sleuth/autoconfig/NoOpTraceContext.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.cloud.sleuth.autoconfig; 18 | 19 | import org.springframework.cloud.sleuth.TraceContext; 20 | 21 | /** 22 | * A noop implementation. Does nothing. 23 | * 24 | * @author Marcin Grzejszczak 25 | * @since 3.0.0 26 | */ 27 | class NoOpTraceContext implements TraceContext { 28 | 29 | @Override 30 | public String traceId() { 31 | return ""; 32 | } 33 | 34 | @Override 35 | public String parentId() { 36 | return ""; 37 | } 38 | 39 | @Override 40 | public String spanId() { 41 | return ""; 42 | } 43 | 44 | @Override 45 | public Boolean sampled() { 46 | return false; 47 | } 48 | 49 | } 50 | -------------------------------------------------------------------------------- /spring-cloud-sleuth-autoconfigure/src/test/java/org/springframework/cloud/sleuth/autoconfig/SleuthNewSpanParserAnnotationDisableTests.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.cloud.sleuth.autoconfig; 18 | 19 | import org.junit.jupiter.api.Test; 20 | 21 | import org.springframework.beans.factory.annotation.Autowired; 22 | import org.springframework.boot.test.context.SpringBootTest; 23 | import org.springframework.cloud.sleuth.annotation.NewSpanParser; 24 | 25 | import static org.assertj.core.api.Assertions.assertThat; 26 | 27 | @SpringBootTest(classes = SleuthAnnotationConfiguration.class, properties = "spring.sleuth.annotation.enabled=false") 28 | public class SleuthNewSpanParserAnnotationDisableTests { 29 | 30 | @Autowired(required = false) 31 | NewSpanParser newSpanParser; 32 | 33 | @Test 34 | public void shouldNotAutowireBecauseConfigIsDisabled() { 35 | assertThat(this.newSpanParser).isNull(); 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /spring-cloud-sleuth-autoconfigure/src/test/java/org/springframework/cloud/sleuth/autoconfig/zipkin2/ZipkinWithDisabledSleuthTests.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.cloud.sleuth.autoconfig.zipkin2; 18 | 19 | import org.junit.jupiter.api.Test; 20 | 21 | import org.springframework.boot.autoconfigure.EnableAutoConfiguration; 22 | import org.springframework.test.context.ContextConfiguration; 23 | import org.springframework.test.context.TestPropertySource; 24 | 25 | @ContextConfiguration(classes = ZipkinWithDisabledSleuthTests.Config.class) 26 | @TestPropertySource(properties = "spring.sleuth.enabled=false") 27 | public class ZipkinWithDisabledSleuthTests { 28 | 29 | @Test 30 | public void shouldStartContext() { 31 | 32 | } 33 | 34 | @EnableAutoConfiguration 35 | static class Config { 36 | 37 | } 38 | 39 | } 40 | -------------------------------------------------------------------------------- /spring-cloud-sleuth-autoconfigure/src/test/resources/META-INF/spring.factories: -------------------------------------------------------------------------------- 1 | # Auto Configuration 2 | org.springframework.boot.autoconfigure.EnableAutoConfiguration=\ 3 | org.springframework.cloud.sleuth.autoconfig.TraceNoOpAutoConfiguration,\ 4 | org.springframework.cloud.sleuth.SleuthTestAutoConfiguration -------------------------------------------------------------------------------- /spring-cloud-sleuth-autoconfigure/src/test/resources/application-baggage.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | sleuth: 3 | baggage: 4 | foo: bar 5 | remoteFields: 6 | - country-code 7 | - x-vcap-request-id 8 | tagFields: 9 | - country-code 10 | -------------------------------------------------------------------------------- /spring-cloud-sleuth-autoconfigure/src/test/resources/application-disabled.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | application: 3 | name: disabledapplication 4 | sleuth: 5 | enabled: false 6 | -------------------------------------------------------------------------------- /spring-cloud-sleuth-autoconfigure/src/test/resources/application.yml: -------------------------------------------------------------------------------- 1 | logging.level.org.springframework.cloud: DEBUG 2 | 3 | spring.autoconfigure.exclude: org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration, org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration, org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration, org.springframework.boot.autoconfigure.data.web.SpringDataWebAutoConfiguration, org.springframework.cloud.gateway.config.GatewayAutoConfiguration, org.springframework.cloud.gateway.config.GatewayClassPathWarningAutoConfiguration, org.springframework.cloud.gateway.config.GatewayMetricsAutoConfiguration, org.springframework.boot.actuate.autoconfigure.security.servlet.ManagementWebSecurityAutoConfiguration, org.springframework.boot.autoconfigure.r2dbc.R2dbcAutoConfiguration, org.springframework.boot.autoconfigure.mongo.MongoAutoConfiguration, org.springframework.boot.autoconfigure.data.mongo.MongoDataAutoConfiguration, org.springframework.cloud.gateway.config.GatewayRedisAutoConfiguration, org.springframework.boot.autoconfigure.data.redis.RedisAutoConfiguration, org.springframework.boot.autoconfigure.cassandra.CassandraAutoConfiguration 4 | -------------------------------------------------------------------------------- /spring-cloud-sleuth-brave/src/main/java/org/springframework/cloud/sleuth/brave/LocalServiceName.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.cloud.sleuth.brave; 18 | 19 | import java.lang.annotation.Documented; 20 | import java.lang.annotation.ElementType; 21 | import java.lang.annotation.Retention; 22 | import java.lang.annotation.RetentionPolicy; 23 | import java.lang.annotation.Target; 24 | 25 | import org.springframework.beans.factory.annotation.Value; 26 | 27 | /** 28 | * Injects the service name for this application. 29 | * 30 | * @author Marcin Grzejszczak 31 | * @since 2.2.0 32 | */ 33 | @Target({ ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER, ElementType.ANNOTATION_TYPE }) 34 | @Retention(RetentionPolicy.RUNTIME) 35 | @Documented 36 | @Value("${spring.zipkin.service.name:${spring.application.name:default}}") 37 | public @interface LocalServiceName { 38 | 39 | } 40 | -------------------------------------------------------------------------------- /spring-cloud-sleuth-brave/src/main/java/org/springframework/cloud/sleuth/brave/instrument/grpc/GrpcManagedChannelBuilderCustomizer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.cloud.sleuth.brave.instrument.grpc; 18 | 19 | import io.grpc.ManagedChannelBuilder; 20 | 21 | /** 22 | * Callback interface that can be implemented by beans wishing to further customize the 23 | * {@link io.grpc.ManagedChannelBuilder} via the {@link SpringAwareManagedChannelBuilder}. 24 | * 25 | * @author Tyler Van Gorder 26 | * @since 3.0.0 27 | */ 28 | public interface GrpcManagedChannelBuilderCustomizer { 29 | 30 | /** 31 | * Customizes the channel builder. 32 | * @param managedChannelBuilder the builder to customize 33 | */ 34 | void customize(ManagedChannelBuilder managedChannelBuilder); 35 | 36 | } 37 | -------------------------------------------------------------------------------- /spring-cloud-sleuth-brave/src/main/java/org/springframework/cloud/sleuth/brave/instrument/messaging/ConditionalOnMessagingEnabled.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.cloud.sleuth.brave.instrument.messaging; 18 | 19 | import java.lang.annotation.Documented; 20 | import java.lang.annotation.ElementType; 21 | import java.lang.annotation.Retention; 22 | import java.lang.annotation.RetentionPolicy; 23 | import java.lang.annotation.Target; 24 | 25 | import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; 26 | 27 | /** 28 | * Verifies if messaging property was enabled. 29 | * 30 | * @author Marcin Grzejszczak 31 | * @since 2.0.0 32 | */ 33 | @Retention(RetentionPolicy.RUNTIME) 34 | @Target({ ElementType.TYPE, ElementType.METHOD }) 35 | @Documented 36 | @ConditionalOnProperty(value = "spring.sleuth.messaging.enabled", matchIfMissing = true) 37 | public @interface ConditionalOnMessagingEnabled { 38 | 39 | } 40 | -------------------------------------------------------------------------------- /spring-cloud-sleuth-brave/src/main/java/org/springframework/cloud/sleuth/brave/instrument/redis/ClientResourcesBuilderCustomizer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.cloud.sleuth.brave.instrument.redis; 18 | 19 | import io.lettuce.core.resource.ClientResources; 20 | 21 | /** 22 | * Customizer for {@link ClientResources.Builder}. 23 | * 24 | * @author Marcin Grzejszczak 25 | * @since 3.0.4 26 | */ 27 | public interface ClientResourcesBuilderCustomizer { 28 | 29 | /** 30 | * Customizes the builder. 31 | * @param builder builder to customize 32 | */ 33 | void customize(ClientResources.Builder builder); 34 | 35 | } 36 | -------------------------------------------------------------------------------- /spring-cloud-sleuth-brave/src/main/java/org/springframework/cloud/sleuth/brave/instrument/web/ServletUtils.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.cloud.sleuth.brave.instrument.web; 18 | 19 | import javax.servlet.http.HttpServletRequest; 20 | import javax.servlet.http.HttpServletResponse; 21 | 22 | /** 23 | * Utility class to retrieve data from Servlet HTTP request and response. 24 | * 25 | * @author Marcin Grzejszczak 26 | * @since 1.0.0 27 | */ 28 | final class ServletUtils { 29 | 30 | private ServletUtils() { 31 | 32 | } 33 | 34 | static String getHeader(HttpServletRequest request, HttpServletResponse response, String name) { 35 | String value = request.getHeader(name); 36 | return value != null ? value : response.getHeader(name); 37 | } 38 | 39 | } 40 | -------------------------------------------------------------------------------- /spring-cloud-sleuth-brave/src/main/java/org/springframework/cloud/sleuth/brave/instrument/web/SkipPatternHttpClientSampler.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.cloud.sleuth.brave.instrument.web; 18 | 19 | import java.util.regex.Pattern; 20 | 21 | public class SkipPatternHttpClientSampler extends SkipPatternSampler { 22 | 23 | private final Pattern skipPattern; 24 | 25 | public SkipPatternHttpClientSampler(Pattern skipPattern) { 26 | this.skipPattern = skipPattern; 27 | } 28 | 29 | @Override 30 | Pattern getPattern() { 31 | return skipPattern; 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /spring-cloud-sleuth-brave/src/main/java/org/springframework/cloud/sleuth/brave/instrument/web/SkipPatternHttpServerSampler.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.cloud.sleuth.brave.instrument.web; 18 | 19 | import java.util.regex.Pattern; 20 | 21 | import org.springframework.cloud.sleuth.instrument.web.SkipPatternProvider; 22 | 23 | /** 24 | * Http Sampler that looks at paths. 25 | * 26 | * @author Marcin Grzejszczak 27 | * @since 3.0.0 28 | */ 29 | public class SkipPatternHttpServerSampler extends SkipPatternSampler { 30 | 31 | private final SkipPatternProvider provider; 32 | 33 | public SkipPatternHttpServerSampler(SkipPatternProvider provider) { 34 | this.provider = provider; 35 | } 36 | 37 | @Override 38 | Pattern getPattern() { 39 | return this.provider.skipPattern(); 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /spring-cloud-sleuth-brave/src/main/java/org/springframework/cloud/sleuth/brave/propagation/PropagationFactorySupplier.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.cloud.sleuth.brave.propagation; 18 | 19 | import brave.propagation.Propagation; 20 | 21 | /** 22 | * Provides logic for supplying of a {@link Propagation.Factory}. 23 | * 24 | * @author Marcin Grzejszczak 25 | * @since 3.0.0 26 | */ 27 | public interface PropagationFactorySupplier { 28 | 29 | /** 30 | * @return an instance of a {@link Propagation.Factory} 31 | */ 32 | Propagation.Factory get(); 33 | 34 | } 35 | -------------------------------------------------------------------------------- /spring-cloud-sleuth-brave/src/main/java/org/springframework/cloud/sleuth/brave/propagation/PropagationType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.cloud.sleuth.brave.propagation; 18 | 19 | /* 20 | * Supported propagation types. 21 | * 22 | * @author Marcin Grzejszczak 23 | * @since 3.0.0 24 | */ 25 | public enum PropagationType { 26 | 27 | /** 28 | * AWS propagation type. 29 | */ 30 | AWS, 31 | 32 | /** 33 | * B3 propagation type. 34 | */ 35 | B3, 36 | 37 | /** 38 | * W3C propagation type. 39 | */ 40 | W3C, 41 | 42 | /** 43 | * Custom propagation type. If picked, requires bean registration overriding the 44 | * default propagation mechanisms. 45 | */ 46 | CUSTOM 47 | 48 | } 49 | -------------------------------------------------------------------------------- /spring-cloud-sleuth-brave/src/test/java/org/springframework/cloud/sleuth/brave/bridge/BraveHttpClientHandlerTests.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.cloud.sleuth.brave.bridge; 18 | 19 | import brave.Tracing; 20 | import brave.http.HttpClientHandler; 21 | import brave.http.HttpTracing; 22 | import org.junit.jupiter.api.Test; 23 | 24 | class BraveHttpClientHandlerTests { 25 | 26 | @Test 27 | void should_not_throw_exception_when_response_null() { 28 | Tracing tracing = Tracing.newBuilder().build(); 29 | brave.http.HttpClientHandler delegate = HttpClientHandler 30 | .create(HttpTracing.newBuilder(tracing).build()); 31 | BraveHttpClientHandler handler = new BraveHttpClientHandler(delegate); 32 | 33 | handler.handleReceive(null, new BraveSpan(tracing.currentTracer().nextSpan())); 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /spring-cloud-sleuth-brave/src/test/resources/META-INF/spring.factories: -------------------------------------------------------------------------------- 1 | # Auto Configuration 2 | org.springframework.boot.autoconfigure.EnableAutoConfiguration=\ 3 | org.springframework.cloud.sleuth.SleuthTestAutoConfiguration 4 | -------------------------------------------------------------------------------- /spring-cloud-sleuth-brave/src/test/resources/application-baggage.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | sleuth: 3 | baggage: 4 | foo: bar 5 | remoteFields: 6 | - country-code 7 | - x-vcap-request-id 8 | tagFields: 9 | - country-code 10 | -------------------------------------------------------------------------------- /spring-cloud-sleuth-brave/src/test/resources/application.yml: -------------------------------------------------------------------------------- 1 | eureka.client.enabled: false 2 | 3 | spring.sleuth.scheduled.skipPattern: "^org.*TestBeanWithScheduledMethodToBeIgnored$" 4 | 5 | logging.level.org.springframework.cloud: DEBUG 6 | logging.level.com.netflix.discovery.InstanceInfoReplicator: ERROR 7 | logging.level.org.springframework.cloud.sleuth.instrument.web.client.feign: TRACE 8 | 9 | spring.autoconfigure.exclude: org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration, org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration, org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration, org.springframework.boot.autoconfigure.data.web.SpringDataWebAutoConfiguration, org.springframework.cloud.gateway.config.GatewayAutoConfiguration, org.springframework.cloud.gateway.config.GatewayClassPathWarningAutoConfiguration, org.springframework.cloud.gateway.config.GatewayMetricsAutoConfiguration 10 | -------------------------------------------------------------------------------- /spring-cloud-sleuth-brave/src/test/resources/bootstrap-disabled.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | application: 3 | name: disabledapplication 4 | sleuth: 5 | enabled: false 6 | -------------------------------------------------------------------------------- /spring-cloud-sleuth-instrumentation/src/main/java/org/springframework/cloud/sleuth/instrument/annotation/SleuthAnnotatedParameter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.cloud.sleuth.instrument.annotation; 18 | 19 | import org.springframework.cloud.sleuth.annotation.SpanTag; 20 | 21 | /** 22 | * A container class that holds information about the parameter of the annotated method 23 | * argument. 24 | * 25 | * @author Christian Schwerdtfeger 26 | * @since 1.2.0 27 | */ 28 | class SleuthAnnotatedParameter { 29 | 30 | final int parameterIndex; 31 | 32 | final SpanTag annotation; 33 | 34 | final Object argument; 35 | 36 | SleuthAnnotatedParameter(int parameterIndex, SpanTag annotation, Object argument) { 37 | this.parameterIndex = parameterIndex; 38 | this.annotation = annotation; 39 | this.argument = argument; 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /spring-cloud-sleuth-instrumentation/src/main/java/org/springframework/cloud/sleuth/instrument/cassandra/CassandraSpanCustomizer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.cloud.sleuth.instrument.cassandra; 18 | 19 | /** 20 | * Provides additional customization for a Cassandra span. Used internally - do not 21 | * implement. 22 | * 23 | * @author Mark Paluch 24 | * @author Marcin Grzejszczak 25 | * @since 3.1.0 26 | */ 27 | public interface CassandraSpanCustomizer { 28 | 29 | /** 30 | * Provides additional customization for a Cassandra span. 31 | * @param defaultName default name of the span 32 | */ 33 | void customizeSpan(String defaultName); 34 | 35 | } 36 | -------------------------------------------------------------------------------- /spring-cloud-sleuth-instrumentation/src/main/java/org/springframework/cloud/sleuth/instrument/cassandra/CassandraSpanSupplier.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.cloud.sleuth.instrument.cassandra; 18 | 19 | import org.springframework.cloud.sleuth.Span; 20 | 21 | /** 22 | * Returns the Cassandra span. 23 | * 24 | * Used internally - do not implement. 25 | * 26 | * @author Mark Paluch 27 | * @author Marcin Grzejszczak 28 | * @since 3.1.0 29 | */ 30 | public interface CassandraSpanSupplier { 31 | 32 | /** 33 | * @return span 34 | */ 35 | Span getSpan(); 36 | 37 | } 38 | -------------------------------------------------------------------------------- /spring-cloud-sleuth-instrumentation/src/main/java/org/springframework/cloud/sleuth/instrument/cassandra/TraceCqlSessionBuilderCustomizer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.cloud.sleuth.instrument.cassandra; 18 | 19 | import com.datastax.oss.driver.api.core.CqlSessionBuilder; 20 | 21 | import org.springframework.boot.autoconfigure.cassandra.CqlSessionBuilderCustomizer; 22 | 23 | /** 24 | * Adds tracing mechanism to the {@link CqlSessionBuilder}. 25 | * 26 | * @author Mark Paluch 27 | * @author Marcin Grzejszczak 28 | * @since 3.1.0 29 | */ 30 | public class TraceCqlSessionBuilderCustomizer implements CqlSessionBuilderCustomizer { 31 | 32 | @Override 33 | public void customize(CqlSessionBuilder cqlSessionBuilder) { 34 | cqlSessionBuilder.withRequestTracker(TraceRequestTracker.INSTANCE); 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /spring-cloud-sleuth-instrumentation/src/main/java/org/springframework/cloud/sleuth/instrument/circuitbreaker/SleuthCircuitBreakerSpan.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.cloud.sleuth.instrument.circuitbreaker; 18 | 19 | import org.springframework.cloud.sleuth.docs.DocumentedSpan; 20 | 21 | enum SleuthCircuitBreakerSpan implements DocumentedSpan { 22 | 23 | /** 24 | * Span created when we wrap a Supplier passed to the CircuitBreaker. 25 | */ 26 | CIRCUIT_BREAKER_SUPPLIER_SPAN { 27 | @Override 28 | public String getName() { 29 | return "%s"; 30 | } 31 | }, 32 | 33 | /** 34 | * Span created when we wrap a Function passed to the CircuitBreaker. as fallback. 35 | */ 36 | CIRCUIT_BREAKER_FUNCTION_SPAN { 37 | @Override 38 | public String getName() { 39 | return "%s"; 40 | } 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /spring-cloud-sleuth-instrumentation/src/main/java/org/springframework/cloud/sleuth/instrument/jdbc/DataSourceDecorator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.cloud.sleuth.instrument.jdbc; 18 | 19 | import javax.sql.DataSource; 20 | 21 | /** 22 | * Decorator for context {@link DataSource} beans. 23 | * 24 | * @author Arthur Gavlyukovskiy 25 | * @since 3.1.0 26 | */ 27 | public interface DataSourceDecorator { 28 | 29 | /** 30 | * Decorates given {@link DataSource} instance. Should either return wrapped 31 | * {@link DataSource} or same instance. 32 | * @param beanName name of a bean 33 | * @param dataSource bean instance 34 | * @return decorated {@link DataSource} or given {@link DataSource} without changes. 35 | */ 36 | DataSource decorate(String beanName, DataSource dataSource); 37 | 38 | } 39 | -------------------------------------------------------------------------------- /spring-cloud-sleuth-instrumentation/src/main/java/org/springframework/cloud/sleuth/instrument/jdbc/DataSourceProxyConnectionIdManagerProvider.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.cloud.sleuth.instrument.jdbc; 18 | 19 | import java.util.function.Supplier; 20 | 21 | import net.ttddyy.dsproxy.ConnectionIdManager; 22 | 23 | /** 24 | * Supplier of a {@link ConnectionIdManager}. 25 | * 26 | * @author Arthur Gavlyukovskiy 27 | * @since 3.1.0 28 | */ 29 | public interface DataSourceProxyConnectionIdManagerProvider extends Supplier { 30 | 31 | } 32 | -------------------------------------------------------------------------------- /spring-cloud-sleuth-instrumentation/src/main/java/org/springframework/cloud/sleuth/instrument/jdbc/TraceType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.cloud.sleuth.instrument.jdbc; 18 | 19 | /** 20 | * Trace types. 21 | */ 22 | public enum TraceType { 23 | 24 | /** 25 | * Related to JDBC connections. 26 | */ 27 | CONNECTION, 28 | 29 | /** 30 | * Related to query executions. 31 | */ 32 | QUERY, 33 | 34 | /** 35 | * Related to ResultSets. 36 | */ 37 | FETCH 38 | 39 | } 40 | -------------------------------------------------------------------------------- /spring-cloud-sleuth-instrumentation/src/main/java/org/springframework/cloud/sleuth/instrument/kafka/TracingKafkaPropagatorSetter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.cloud.sleuth.instrument.kafka; 18 | 19 | import org.apache.kafka.clients.producer.ProducerRecord; 20 | 21 | import org.springframework.cloud.sleuth.propagation.Propagator; 22 | 23 | /** 24 | * Setter injecting the values onto the {@link ProducerRecord} headers for Kafka based 25 | * communication. 26 | * 27 | * @author Anders Clausen 28 | * @author Flaviu Muresan 29 | * @since 3.1.0 30 | */ 31 | public class TracingKafkaPropagatorSetter implements Propagator.Setter> { 32 | 33 | @Override 34 | public void set(ProducerRecord carrier, String key, String value) { 35 | if (carrier != null) { 36 | carrier.headers().add(key, value.getBytes()); 37 | } 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /spring-cloud-sleuth-instrumentation/src/main/java/org/springframework/cloud/sleuth/instrument/mongodb/TraceMongoSpanCustomizer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.cloud.sleuth.instrument.mongodb; 18 | 19 | import com.mongodb.event.CommandStartedEvent; 20 | 21 | import org.springframework.cloud.sleuth.Span; 22 | 23 | /** 24 | * Customizer for the child span wrapping the call to Mongo. 25 | * 26 | * @author Marcin Grzejszczak 27 | * @since 3.1.0 28 | */ 29 | public interface TraceMongoSpanCustomizer { 30 | 31 | /** 32 | * Customizes the Span created from the {@link CommandStartedEvent}. 33 | * @param commandStartedEvent event from Mongo 34 | * @param spanBuilder span builder to customize 35 | */ 36 | void customizeCommandStartSpan(CommandStartedEvent commandStartedEvent, Span.Builder spanBuilder); 37 | 38 | } 39 | -------------------------------------------------------------------------------- /spring-cloud-sleuth-instrumentation/src/main/java/org/springframework/cloud/sleuth/instrument/quartz/SleuthQuartzSpan.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.cloud.sleuth.instrument.quartz; 18 | 19 | import org.springframework.cloud.sleuth.docs.DocumentedSpan; 20 | import org.springframework.cloud.sleuth.docs.TagKey; 21 | 22 | enum SleuthQuartzSpan implements DocumentedSpan { 23 | 24 | /** 25 | * Span created when trigger is fired and then completed. 26 | */ 27 | QUARTZ_TRIGGER_SPAN { 28 | @Override 29 | public String getName() { 30 | return "%s"; 31 | } 32 | 33 | @Override 34 | public TagKey[] getTagKeys() { 35 | return Tags.values(); 36 | } 37 | }; 38 | 39 | enum Tags implements TagKey { 40 | 41 | /** 42 | * Name of the trigger. 43 | */ 44 | TRIGGER { 45 | @Override 46 | public String getKey() { 47 | return "quartz.trigger"; 48 | } 49 | } 50 | 51 | } 52 | 53 | } 54 | -------------------------------------------------------------------------------- /spring-cloud-sleuth-instrumentation/src/main/java/org/springframework/cloud/sleuth/instrument/reactor/TraceContextPropagator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.cloud.sleuth.instrument.reactor; 18 | 19 | /** 20 | * Only for internal use. Marker interface for Publisher and Subscriber that propagate 21 | * Tracing context into execution Thread. 22 | */ 23 | public interface TraceContextPropagator { 24 | 25 | } 26 | -------------------------------------------------------------------------------- /spring-cloud-sleuth-instrumentation/src/main/java/org/springframework/cloud/sleuth/instrument/rsocket/ByteBufGetter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.cloud.sleuth.instrument.rsocket; 18 | 19 | import io.netty.buffer.ByteBuf; 20 | import io.netty.util.CharsetUtil; 21 | import io.rsocket.metadata.CompositeMetadata; 22 | 23 | import org.springframework.cloud.sleuth.propagation.Propagator; 24 | 25 | class ByteBufGetter implements Propagator.Getter { 26 | 27 | @Override 28 | public String get(ByteBuf carrier, String key) { 29 | final CompositeMetadata compositeMetadata = new CompositeMetadata(carrier, false); 30 | for (CompositeMetadata.Entry entry : compositeMetadata) { 31 | if (key.equals(entry.getMimeType())) { 32 | return entry.getContent().toString(CharsetUtil.UTF_8); 33 | } 34 | } 35 | return null; 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /spring-cloud-sleuth-instrumentation/src/main/java/org/springframework/cloud/sleuth/instrument/rsocket/ByteBufSetter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.cloud.sleuth.instrument.rsocket; 18 | 19 | import io.netty.buffer.ByteBufAllocator; 20 | import io.netty.buffer.ByteBufUtil; 21 | import io.netty.buffer.CompositeByteBuf; 22 | import io.rsocket.metadata.CompositeMetadataCodec; 23 | 24 | import org.springframework.cloud.sleuth.propagation.Propagator; 25 | 26 | class ByteBufSetter implements Propagator.Setter { 27 | 28 | @Override 29 | public void set(CompositeByteBuf carrier, String key, String value) { 30 | final ByteBufAllocator alloc = carrier.alloc(); 31 | CompositeMetadataCodec.encodeAndAddMetadataWithCompression(carrier, alloc, key, 32 | ByteBufUtil.writeUtf8(alloc, value)); 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /spring-cloud-sleuth-instrumentation/src/main/java/org/springframework/cloud/sleuth/instrument/rsocket/CompositeMetadataUtils.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.cloud.sleuth.instrument.rsocket; 18 | 19 | import io.netty.buffer.ByteBuf; 20 | import io.rsocket.metadata.CompositeMetadata; 21 | 22 | import org.springframework.lang.Nullable; 23 | 24 | final class CompositeMetadataUtils { 25 | 26 | private CompositeMetadataUtils() { 27 | throw new IllegalStateException("Can't instantiate a utility class"); 28 | } 29 | 30 | @Nullable 31 | static ByteBuf extract(ByteBuf metadata, String key) { 32 | final CompositeMetadata compositeMetadata = new CompositeMetadata(metadata, false); 33 | for (CompositeMetadata.Entry entry : compositeMetadata) { 34 | final String entryKey = entry.getMimeType(); 35 | if (key.equals(entryKey)) { 36 | return entry.getContent(); 37 | } 38 | } 39 | return null; 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /spring-cloud-sleuth-instrumentation/src/main/java/org/springframework/cloud/sleuth/instrument/task/SleuthTaskSpan.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.cloud.sleuth.instrument.task; 18 | 19 | import org.springframework.cloud.sleuth.docs.DocumentedSpan; 20 | 21 | enum SleuthTaskSpan implements DocumentedSpan { 22 | 23 | /** 24 | * Span created when a task runner is executed. 25 | */ 26 | TASK_RUNNER_SPAN { 27 | @Override 28 | public String getName() { 29 | return "%s"; 30 | } 31 | }, 32 | 33 | /** 34 | * Span created within the lifecycle of a task. 35 | */ 36 | TASK_EXECUTION_LISTENER_SPAN { 37 | @Override 38 | public String getName() { 39 | return "%s"; 40 | } 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /spring-cloud-sleuth-instrumentation/src/main/java/org/springframework/cloud/sleuth/instrument/web/SkipPatternProvider.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.cloud.sleuth.instrument.web; 18 | 19 | import java.util.regex.Pattern; 20 | 21 | /** 22 | * Provides a URL {@link Pattern} for spans that should be not sampled. 23 | * 24 | * @author Marcin Grzejszczak 25 | * @since 2.0.0 26 | */ 27 | public interface SkipPatternProvider { 28 | 29 | Pattern skipPattern(); 30 | 31 | } 32 | -------------------------------------------------------------------------------- /spring-cloud-sleuth-instrumentation/src/main/java/org/springframework/cloud/sleuth/instrument/web/SpanFromContextRetriever.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.cloud.sleuth.instrument.web; 18 | 19 | import java.util.regex.Pattern; 20 | 21 | import reactor.util.context.Context; 22 | 23 | import org.springframework.cloud.sleuth.Span; 24 | 25 | /** 26 | * Provides a URL {@link Pattern} for spans that should be not sampled. 27 | * 28 | * @author Marcin Grzejszczak 29 | * @since 3.0.2 30 | */ 31 | public interface SpanFromContextRetriever { 32 | 33 | /** 34 | * @param context - Reactor context 35 | * @return span or {@code null} if no span present 36 | */ 37 | default Span findSpan(Context context) { 38 | return null; 39 | }; 40 | 41 | } 42 | -------------------------------------------------------------------------------- /spring-cloud-sleuth-instrumentation/src/main/java/org/springframework/cloud/sleuth/instrument/web/mvc/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /** 18 | * This module is fully adopted from io.zipkin.brave-instrumentation-web and 19 | * io.zipkin.brave-instrumentation-webmvc JAR. 20 | */ 21 | package org.springframework.cloud.sleuth.instrument.web.mvc; 22 | -------------------------------------------------------------------------------- /spring-cloud-sleuth-instrumentation/src/main/java/org/springframework/cloud/sleuth/instrument/web/servlet/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /** 18 | * This module is fully adopted from io.zipkin.brave-instrumentation-servlet JAR. 19 | */ 20 | package org.springframework.cloud.sleuth.instrument.web.servlet; 21 | -------------------------------------------------------------------------------- /spring-cloud-sleuth-instrumentation/src/test/java/org/springframework/cloud/sleuth/annotation/NoOpTagValueResolverTests.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.cloud.sleuth.annotation; 18 | 19 | import org.junit.jupiter.api.Test; 20 | 21 | import static org.assertj.core.api.BDDAssertions.then; 22 | 23 | /** 24 | * @author Marcin Grzejszczak 25 | */ 26 | public class NoOpTagValueResolverTests { 27 | 28 | @Test 29 | public void should_return_null() throws Exception { 30 | then(new NoOpTagValueResolver().resolve("")).isNull(); 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /spring-cloud-sleuth-instrumentation/src/test/java/org/springframework/cloud/sleuth/instrument/cassandra/TraceCqlSessionBuilderCustomizerTests.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.cloud.sleuth.instrument.cassandra; 18 | 19 | import com.datastax.oss.driver.api.core.CqlSessionBuilder; 20 | import org.junit.jupiter.api.Test; 21 | 22 | import static org.mockito.ArgumentMatchers.isA; 23 | import static org.mockito.BDDMockito.then; 24 | import static org.mockito.Mockito.mock; 25 | 26 | class TraceCqlSessionBuilderCustomizerTests { 27 | 28 | @Test 29 | void should_register_trace_request_tracker() { 30 | TraceCqlSessionBuilderCustomizer customizer = new TraceCqlSessionBuilderCustomizer(); 31 | CqlSessionBuilder builder = mock(CqlSessionBuilder.class); 32 | 33 | customizer.customize(builder); 34 | 35 | then(builder).should().withRequestTracker(isA(TraceRequestTracker.class)); 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /spring-cloud-sleuth-instrumentation/src/test/java/org/springframework/cloud/sleuth/instrument/jdbc/DataSourceNameResolverTests.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.cloud.sleuth.instrument.jdbc; 18 | 19 | import org.junit.jupiter.api.Test; 20 | 21 | import static org.assertj.core.api.BDDAssertions.then; 22 | 23 | class DataSourceNameResolverTests { 24 | 25 | @Test 26 | void should_return_default_string_exception_when_datasource_is_null() { 27 | DataSourceNameResolver resolver = new DataSourceNameResolver(); 28 | 29 | then(resolver.resolveDataSourceName(null)).isNotBlank(); 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /spring-cloud-sleuth-instrumentation/src/test/java/org/springframework/cloud/sleuth/instrument/tx/TraceKafkaPlatformTransactionManagerTests.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.cloud.sleuth.instrument.tx; 18 | 19 | import org.mockito.Mockito; 20 | 21 | import org.springframework.kafka.transaction.KafkaAwareTransactionManager; 22 | 23 | class TraceKafkaPlatformTransactionManagerTests extends TracePlatformTransactionManagerTests { 24 | 25 | KafkaAwareTransactionManager delegate = Mockito.mock(KafkaAwareTransactionManager.class); 26 | 27 | @Override 28 | TraceKafkaAwareTransactionManager manager() { 29 | final TraceKafkaAwareTransactionManager manager = new TraceKafkaAwareTransactionManager(getDelegate(), 30 | beanFactory()); 31 | manager.initialize(); 32 | return manager; 33 | } 34 | 35 | @Override 36 | KafkaAwareTransactionManager getDelegate() { 37 | return this.delegate; 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /spring-cloud-sleuth-instrumentation/src/test/java/org/springframework/cloud/sleuth/tracer/NoOpSpanInScope.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.cloud.sleuth.tracer; 18 | 19 | import org.springframework.cloud.sleuth.Tracer; 20 | 21 | /** 22 | * A noop implementation. Does nothing. 23 | * 24 | * @author Marcin Grzejszczak 25 | * @since 3.0.0 26 | */ 27 | public class NoOpSpanInScope implements Tracer.SpanInScope { 28 | 29 | @Override 30 | public void close() { 31 | 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /spring-cloud-sleuth-instrumentation/src/test/java/org/springframework/cloud/sleuth/tracer/NoOpTraceContext.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.cloud.sleuth.tracer; 18 | 19 | import org.springframework.cloud.sleuth.TraceContext; 20 | 21 | /** 22 | * A noop implementation. Does nothing. 23 | * 24 | * @author Marcin Grzejszczak 25 | * @since 3.0.0 26 | */ 27 | public class NoOpTraceContext implements TraceContext { 28 | 29 | @Override 30 | public String traceId() { 31 | return ""; 32 | } 33 | 34 | @Override 35 | public String parentId() { 36 | return ""; 37 | } 38 | 39 | @Override 40 | public String spanId() { 41 | return ""; 42 | } 43 | 44 | @Override 45 | public Boolean sampled() { 46 | return false; 47 | } 48 | 49 | } 50 | -------------------------------------------------------------------------------- /spring-cloud-sleuth-instrumentation/src/test/resources/META-INF/spring.factories: -------------------------------------------------------------------------------- 1 | # Auto Configuration 2 | org.springframework.boot.autoconfigure.EnableAutoConfiguration=\ 3 | org.springframework.cloud.sleuth.autoconfig.TraceNoOpAutoConfiguration -------------------------------------------------------------------------------- /spring-cloud-sleuth-instrumentation/src/test/resources/application.yml: -------------------------------------------------------------------------------- 1 | logging.level.org.springframework.cloud: DEBUG 2 | logging.level.com.netflix.discovery.InstanceInfoReplicator: ERROR 3 | logging.level.org.springframework.cloud.sleuth.instrument.web.client.feign: TRACE 4 | 5 | spring.autoconfigure.exclude: org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration, org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration, org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration, org.springframework.boot.autoconfigure.data.web.SpringDataWebAutoConfiguration, org.springframework.cloud.gateway.config.GatewayAutoConfiguration, org.springframework.cloud.gateway.config.GatewayClassPathWarningAutoConfiguration, org.springframework.cloud.gateway.config.GatewayMetricsAutoConfiguration, org.springframework.boot.actuate.autoconfigure.security.servlet.ManagementWebSecurityAutoConfiguration 6 | -------------------------------------------------------------------------------- /spring-cloud-sleuth-samples/spring-cloud-sleuth-sample-feign/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | server: 2 | port: 3383 3 | 4 | logging.level.com.netflix.discovery: 'OFF' 5 | 6 | sample: 7 | zipkin: 8 | enabled: false 9 | spring: 10 | -------------------------------------------------------------------------------- /spring-cloud-sleuth-samples/spring-cloud-sleuth-sample-messaging/src/main/java/sample/SampleBackground.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package sample; 18 | 19 | import java.util.Random; 20 | 21 | import org.springframework.beans.factory.annotation.Autowired; 22 | import org.springframework.cloud.sleuth.Tracer; 23 | import org.springframework.scheduling.annotation.Async; 24 | import org.springframework.stereotype.Component; 25 | 26 | /** 27 | * @author Spencer Gibb 28 | */ 29 | @Component 30 | public class SampleBackground { 31 | 32 | @Autowired 33 | private Tracer tracer; 34 | 35 | private Random random = new Random(); 36 | 37 | @Async 38 | public void background() throws InterruptedException { 39 | int millis = this.random.nextInt(1000); 40 | Thread.sleep(millis); 41 | this.tracer.currentSpan().tag("background-sleep-millis", String.valueOf(millis)); 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /spring-cloud-sleuth-samples/spring-cloud-sleuth-sample-messaging/src/main/java/sample/SampleRequestResponse.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package sample; 18 | 19 | import org.springframework.integration.annotation.Gateway; 20 | import org.springframework.integration.annotation.MessagingGateway; 21 | 22 | /** 23 | * @author Dave Syer 24 | * 25 | */ 26 | @MessagingGateway 27 | public interface SampleRequestResponse { 28 | 29 | @Gateway(requestChannel = "xform") 30 | String send(String input); 31 | 32 | } 33 | -------------------------------------------------------------------------------- /spring-cloud-sleuth-samples/spring-cloud-sleuth-sample-messaging/src/main/java/sample/SampleSink.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package sample; 18 | 19 | import org.springframework.integration.annotation.Gateway; 20 | import org.springframework.integration.annotation.MessagingGateway; 21 | 22 | /** 23 | * @author Dave Syer 24 | * 25 | */ 26 | @MessagingGateway 27 | public interface SampleSink { 28 | 29 | @Gateway(requestChannel = "messages") 30 | void send(String message); 31 | 32 | } 33 | -------------------------------------------------------------------------------- /spring-cloud-sleuth-samples/spring-cloud-sleuth-sample-messaging/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | server: 2 | port: 3381 3 | 4 | spring: 5 | application: 6 | name: testSleuthMessaging 7 | sleuth: 8 | log: 9 | json: 10 | 11 | sample: 12 | zipkin: 13 | # enabled: false 14 | -------------------------------------------------------------------------------- /spring-cloud-sleuth-samples/spring-cloud-sleuth-sample-messaging/src/test/java/sample/SampleMessagingApplicationTests.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package sample; 18 | 19 | import org.junit.jupiter.api.Test; 20 | 21 | import org.springframework.boot.test.context.SpringBootTest; 22 | import org.springframework.test.context.TestPropertySource; 23 | 24 | @SpringBootTest(classes = SampleMessagingApplication.class) 25 | @TestPropertySource(properties = "sample.zipkin.enabled=false") 26 | public class SampleMessagingApplicationTests { 27 | 28 | @Test 29 | public void contextLoads() { 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /spring-cloud-sleuth-samples/spring-cloud-sleuth-sample-websocket/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | server: 2 | port: 3383 3 | 4 | spring: 5 | application: 6 | name: testSleuthWebsocket 7 | sleuth: 8 | tracer: 9 | mode: noop 10 | 11 | 12 | sample: 13 | zipkin: 14 | # enabled: false 15 | -------------------------------------------------------------------------------- /spring-cloud-sleuth-samples/spring-cloud-sleuth-sample-websocket/src/test/java/sample/SampleWebsocketApplicationTests.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package sample; 18 | 19 | import org.junit.jupiter.api.Test; 20 | 21 | import org.springframework.boot.test.context.SpringBootTest; 22 | import org.springframework.test.context.TestPropertySource; 23 | import org.springframework.test.context.web.WebAppConfiguration; 24 | 25 | @SpringBootTest(classes = SampleWebsocketApplication.class) 26 | @WebAppConfiguration 27 | @TestPropertySource(properties = "sample.zipkin.enabled=false") 28 | public class SampleWebsocketApplicationTests { 29 | 30 | @Test 31 | public void contextLoads() { 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /spring-cloud-sleuth-samples/spring-cloud-sleuth-sample-zipkin/src/main/java/sample/SampleBackground.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package sample; 18 | 19 | import java.util.Random; 20 | 21 | import org.springframework.beans.factory.annotation.Autowired; 22 | import org.springframework.cloud.sleuth.Tracer; 23 | import org.springframework.scheduling.annotation.Async; 24 | import org.springframework.stereotype.Component; 25 | 26 | /** 27 | * @author Spencer Gibb 28 | */ 29 | @Component 30 | public class SampleBackground { 31 | 32 | @Autowired 33 | private Tracer tracer; 34 | 35 | private Random random = new Random(); 36 | 37 | @Async 38 | public void background() throws InterruptedException { 39 | int millis = this.random.nextInt(1000); 40 | Thread.sleep(millis); 41 | this.tracer.currentSpan().tag("background-sleep-millis", String.valueOf(millis)); 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /spring-cloud-sleuth-samples/spring-cloud-sleuth-sample-zipkin/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | server: 2 | port: 3380 3 | 4 | spring: 5 | application: 6 | # This ends up as the service name in zipkin 7 | name: testsleuthzipkin 8 | #zipkin: 9 | # Uncomment to send to zipkin, replacing 192.168.99.100 with your zipkin IP address 10 | # baseUrl: https://192.168.99.100:9411/ 11 | sleuth: 12 | sampler: 13 | probability: 1.0 14 | 15 | sample: 16 | zipkin: 17 | # When enabled=false, traces log to the console. Comment to send to zipkin 18 | enabled: false 19 | -------------------------------------------------------------------------------- /spring-cloud-sleuth-samples/spring-cloud-sleuth-sample-zipkin/src/test/java/sample/SampleSleuthApplicationTests.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package sample; 18 | 19 | import org.junit.jupiter.api.Test; 20 | 21 | import org.springframework.boot.test.context.SpringBootTest; 22 | import org.springframework.test.context.TestPropertySource; 23 | import org.springframework.test.context.web.WebAppConfiguration; 24 | 25 | @SpringBootTest(classes = SampleZipkinApplication.class) 26 | @WebAppConfiguration 27 | @TestPropertySource(properties = "sample.zipkin.enabled=false") 28 | public class SampleSleuthApplicationTests { 29 | 30 | @Test 31 | public void contextLoads() { 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /spring-cloud-sleuth-samples/spring-cloud-sleuth-sample/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | server: 2 | port: 3379 3 | 4 | spring: 5 | application: 6 | name: testSleuthApp 7 | -------------------------------------------------------------------------------- /spring-cloud-sleuth-samples/spring-cloud-sleuth-sample/src/test/java/sample/SampleSleuthApplicationTests.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package sample; 18 | 19 | import org.junit.jupiter.api.Test; 20 | 21 | import org.springframework.boot.test.context.SpringBootTest; 22 | 23 | @SpringBootTest(classes = SampleSleuthApplication.class) 24 | public class SampleSleuthApplicationTests { 25 | 26 | @Test 27 | public void contextLoads() { 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /spring-cloud-sleuth-zipkin/src/main/java/org/springframework/cloud/sleuth/zipkin2/EndpointLocator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.cloud.sleuth.zipkin2; 18 | 19 | import zipkin2.Endpoint; 20 | 21 | /** 22 | * Strategy for locating a zipkin {@linkplain Endpoint} for the current process. 23 | * 24 | * @author Dave Syer 25 | * @since 1.0.0 26 | */ 27 | public interface EndpointLocator { 28 | 29 | Endpoint local(); 30 | 31 | } 32 | -------------------------------------------------------------------------------- /spring-cloud-sleuth-zipkin/src/main/java/org/springframework/cloud/sleuth/zipkin2/StaticInstanceZipkinLoadBalancer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.cloud.sleuth.zipkin2; 18 | 19 | import java.net.URI; 20 | 21 | /** 22 | * {@link ZipkinLoadBalancer} that provides a fixed URI for Zipkin. 23 | * 24 | * @author Marcin Grzejszczak 25 | * @since 3.0.0 26 | */ 27 | public class StaticInstanceZipkinLoadBalancer implements ZipkinLoadBalancer { 28 | 29 | private final ZipkinProperties zipkinProperties; 30 | 31 | public StaticInstanceZipkinLoadBalancer(ZipkinProperties zipkinProperties) { 32 | this.zipkinProperties = zipkinProperties; 33 | } 34 | 35 | @Override 36 | public URI instance() { 37 | return URI.create(this.zipkinProperties.getBaseUrl()); 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /spring-cloud-sleuth-zipkin/src/main/java/org/springframework/cloud/sleuth/zipkin2/ZipkinHttpClientSender.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.cloud.sleuth.zipkin2; 18 | 19 | import org.springframework.http.MediaType; 20 | 21 | /** 22 | * Sends spans to Zipkin via an HTTP Client. 23 | * 24 | * @author Marcin Grzejszczak 25 | * @since 3.1.1 26 | */ 27 | interface ZipkinHttpClientSender { 28 | 29 | /** 30 | * Sends spans to Zipkin via an HTTP Client. 31 | * @param url Zipkin URL 32 | * @param mediaType HTTP message media type 33 | * @param payload payload to send 34 | */ 35 | void call(String url, MediaType mediaType, byte[] payload); 36 | 37 | } 38 | -------------------------------------------------------------------------------- /spring-cloud-sleuth-zipkin/src/main/java/org/springframework/cloud/sleuth/zipkin2/ZipkinLoadBalancer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.cloud.sleuth.zipkin2; 18 | 19 | import java.net.URI; 20 | 21 | /** 22 | * Load balancing strategy for picking a Zipkin instance. 23 | * 24 | * @author Marcin Grzejszczak 25 | * @since 1.3.0 26 | */ 27 | public interface ZipkinLoadBalancer { 28 | 29 | /** 30 | * Returns a concrete {@link URI} of a Zipkin instance. 31 | * @return {@link URI} of the picked instance 32 | */ 33 | URI instance(); 34 | 35 | } 36 | -------------------------------------------------------------------------------- /spring-cloud-sleuth-zipkin/src/main/java/org/springframework/cloud/sleuth/zipkin2/ZipkinRestTemplateProvider.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.cloud.sleuth.zipkin2; 18 | 19 | import org.springframework.web.client.RestTemplate; 20 | 21 | /** 22 | * A provider for a {@link RestTemplate} used to send spans to Zipkin. 23 | * 24 | * @author Marcin Grzejszczak 25 | * @since 3.1.0 26 | */ 27 | public interface ZipkinRestTemplateProvider { 28 | 29 | RestTemplate zipkinRestTemplate(); 30 | 31 | } 32 | -------------------------------------------------------------------------------- /spring-cloud-sleuth-zipkin/src/main/java/org/springframework/cloud/sleuth/zipkin2/ZipkinUrlExtractor.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.cloud.sleuth.zipkin2; 18 | 19 | import java.net.URI; 20 | 21 | /** 22 | * Provides a way to retrieve Zipkin URI. If there's no discovery client then this value 23 | * will be taken from the properties. Otherwise host will be assumed to be a service id. 24 | * 25 | * @author Marcin Grzejszczak 26 | * @since 3.0.0 27 | */ 28 | public interface ZipkinUrlExtractor { 29 | 30 | URI zipkinUrl(ZipkinProperties zipkinProperties); 31 | 32 | } 33 | -------------------------------------------------------------------------------- /spring-cloud-sleuth-zipkin/src/main/java/org/springframework/cloud/sleuth/zipkin2/ZipkinWebClientBuilderProvider.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.cloud.sleuth.zipkin2; 18 | 19 | import org.springframework.web.reactive.function.client.WebClient; 20 | 21 | /** 22 | * A provider for a {@link WebClient.Builder} used to send spans to Zipkin. 23 | * 24 | * @author Marcin Grzejszczak 25 | * @since 3.1.1 26 | */ 27 | public interface ZipkinWebClientBuilderProvider { 28 | 29 | WebClient.Builder zipkinWebClientBuilder(); 30 | 31 | } 32 | -------------------------------------------------------------------------------- /tests/brave/spring-cloud-sleuth-instrumentation-actuator-tests/src/test/resources/application.yml: -------------------------------------------------------------------------------- 1 | logging.level.org.springframework.cloud: DEBUG 2 | -------------------------------------------------------------------------------- /tests/brave/spring-cloud-sleuth-instrumentation-annotation-tests/src/test/resources/application.yml: -------------------------------------------------------------------------------- 1 | logging.level.org.springframework.cloud: DEBUG 2 | logging.level.com.netflix.discovery.InstanceInfoReplicator: ERROR 3 | logging.level.org.springframework.cloud.sleuth.instrument.web.client.feign: TRACE 4 | 5 | spring.autoconfigure.exclude: org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration, org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration, org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration, org.springframework.boot.autoconfigure.data.web.SpringDataWebAutoConfiguration, org.springframework.cloud.gateway.config.GatewayAutoConfiguration, org.springframework.cloud.gateway.config.GatewayClassPathWarningAutoConfiguration, org.springframework.cloud.gateway.config.GatewayMetricsAutoConfiguration 6 | -------------------------------------------------------------------------------- /tests/brave/spring-cloud-sleuth-instrumentation-async-tests/src/test/java/org/springframework/cloud/sleuth/brave/instrument/async/AsyncDisabledTests.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.cloud.sleuth.brave.instrument.async; 18 | 19 | import org.springframework.boot.test.context.SpringBootTest; 20 | 21 | @SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.NONE) 22 | public class AsyncDisabledTests extends org.springframework.cloud.sleuth.instrument.async.AsyncDisabledTests { 23 | 24 | } 25 | -------------------------------------------------------------------------------- /tests/brave/spring-cloud-sleuth-instrumentation-async-tests/src/test/java/org/springframework/cloud/sleuth/brave/instrument/async/LazyTraceThreadPoolTaskSchedulerTests.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.cloud.sleuth.brave.instrument.async; 18 | 19 | import org.springframework.cloud.sleuth.brave.BraveTestTracing; 20 | import org.springframework.cloud.sleuth.test.TestTracingAware; 21 | 22 | public class LazyTraceThreadPoolTaskSchedulerTests 23 | extends org.springframework.cloud.sleuth.instrument.async.LazyTraceThreadPoolTaskSchedulerTests { 24 | 25 | BraveTestTracing testTracing; 26 | 27 | @Override 28 | public TestTracingAware tracerTest() { 29 | if (this.testTracing == null) { 30 | this.testTracing = new BraveTestTracing(); 31 | } 32 | return this.testTracing; 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /tests/brave/spring-cloud-sleuth-instrumentation-async-tests/src/test/java/org/springframework/cloud/sleuth/brave/instrument/async/TraceAsyncAspectTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.cloud.sleuth.brave.instrument.async; 18 | 19 | import org.springframework.cloud.sleuth.brave.BraveTestTracing; 20 | import org.springframework.cloud.sleuth.test.TestTracingAware; 21 | 22 | /** 23 | * @author Marcin Grzejszczak 24 | */ 25 | public class TraceAsyncAspectTest extends org.springframework.cloud.sleuth.instrument.async.TraceAsyncAspectTest { 26 | 27 | BraveTestTracing testTracing; 28 | 29 | @Override 30 | public TestTracingAware tracerTest() { 31 | if (this.testTracing == null) { 32 | this.testTracing = new BraveTestTracing(); 33 | } 34 | return this.testTracing; 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /tests/brave/spring-cloud-sleuth-instrumentation-async-tests/src/test/java/org/springframework/cloud/sleuth/brave/instrument/async/TraceAsyncListenableTaskExecutorTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.cloud.sleuth.brave.instrument.async; 18 | 19 | import org.springframework.cloud.sleuth.brave.BraveTestTracing; 20 | import org.springframework.cloud.sleuth.test.TestTracingAware; 21 | 22 | /** 23 | * @author Marcin Grzejszczak 24 | */ 25 | public class TraceAsyncListenableTaskExecutorTest 26 | extends org.springframework.cloud.sleuth.instrument.async.TraceAsyncListenableTaskExecutorTest { 27 | 28 | BraveTestTracing testTracing; 29 | 30 | @Override 31 | public TestTracingAware tracerTest() { 32 | if (this.testTracing == null) { 33 | this.testTracing = new BraveTestTracing(); 34 | } 35 | return this.testTracing; 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /tests/brave/spring-cloud-sleuth-instrumentation-async-tests/src/test/java/org/springframework/cloud/sleuth/brave/instrument/async/TraceScheduledThreadPoolExecutorAnotherConstructorTests.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.cloud.sleuth.brave.instrument.async; 18 | 19 | import org.springframework.cloud.sleuth.brave.BraveTestTracing; 20 | import org.springframework.cloud.sleuth.test.TestTracingAware; 21 | 22 | public class TraceScheduledThreadPoolExecutorAnotherConstructorTests extends 23 | org.springframework.cloud.sleuth.instrument.async.TraceScheduledThreadPoolExecutorAnotherConstructorTests { 24 | 25 | BraveTestTracing testTracing; 26 | 27 | @Override 28 | public TestTracingAware tracerTest() { 29 | if (this.testTracing == null) { 30 | this.testTracing = new BraveTestTracing(); 31 | } 32 | return this.testTracing; 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /tests/brave/spring-cloud-sleuth-instrumentation-async-tests/src/test/java/org/springframework/cloud/sleuth/brave/instrument/async/TraceScheduledThreadPoolExecutorTests.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.cloud.sleuth.brave.instrument.async; 18 | 19 | import org.springframework.cloud.sleuth.brave.BraveTestTracing; 20 | import org.springframework.cloud.sleuth.test.TestTracingAware; 21 | 22 | public class TraceScheduledThreadPoolExecutorTests 23 | extends org.springframework.cloud.sleuth.instrument.async.TraceScheduledThreadPoolExecutorTests { 24 | 25 | BraveTestTracing testTracing; 26 | 27 | @Override 28 | public TestTracingAware tracerTest() { 29 | if (this.testTracing == null) { 30 | this.testTracing = new BraveTestTracing(); 31 | } 32 | return this.testTracing; 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /tests/brave/spring-cloud-sleuth-instrumentation-async-tests/src/test/java/org/springframework/cloud/sleuth/brave/instrument/async/TraceThreadPoolTaskExecutorTests.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.cloud.sleuth.brave.instrument.async; 18 | 19 | import org.springframework.cloud.sleuth.brave.BraveTestTracing; 20 | import org.springframework.cloud.sleuth.test.TestTracingAware; 21 | 22 | public class TraceThreadPoolTaskExecutorTests 23 | extends org.springframework.cloud.sleuth.instrument.async.TraceThreadPoolTaskExecutorTests { 24 | 25 | BraveTestTracing testTracing; 26 | 27 | @Override 28 | public TestTracingAware tracerTest() { 29 | if (this.testTracing == null) { 30 | this.testTracing = new BraveTestTracing(); 31 | } 32 | return this.testTracing; 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /tests/brave/spring-cloud-sleuth-instrumentation-async-tests/src/test/java/org/springframework/cloud/sleuth/brave/instrument/async/TraceThreadPoolTaskSchedulerTests.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.cloud.sleuth.brave.instrument.async; 18 | 19 | import org.springframework.cloud.sleuth.brave.BraveTestTracing; 20 | import org.springframework.cloud.sleuth.test.TestTracingAware; 21 | 22 | public class TraceThreadPoolTaskSchedulerTests 23 | extends org.springframework.cloud.sleuth.instrument.async.TraceThreadPoolTaskSchedulerTests { 24 | 25 | BraveTestTracing testTracing; 26 | 27 | @Override 28 | public TestTracingAware tracerTest() { 29 | if (this.testTracing == null) { 30 | this.testTracing = new BraveTestTracing(); 31 | } 32 | return this.testTracing; 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /tests/brave/spring-cloud-sleuth-instrumentation-async-tests/src/test/java/org/springframework/cloud/sleuth/brave/instrument/async/TraceableExecutorServiceTests.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.cloud.sleuth.brave.instrument.async; 18 | 19 | import org.springframework.cloud.sleuth.brave.BraveTestTracing; 20 | import org.springframework.cloud.sleuth.test.TestTracingAware; 21 | 22 | public class TraceableExecutorServiceTests 23 | extends org.springframework.cloud.sleuth.instrument.async.TraceableExecutorServiceTests { 24 | 25 | BraveTestTracing testTracing; 26 | 27 | @Override 28 | public TestTracingAware tracerTest() { 29 | if (this.testTracing == null) { 30 | this.testTracing = new BraveTestTracing(); 31 | } 32 | return this.testTracing; 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /tests/brave/spring-cloud-sleuth-instrumentation-async-tests/src/test/java/org/springframework/cloud/sleuth/brave/instrument/async/TraceableScheduledExecutorServiceTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.cloud.sleuth.brave.instrument.async; 18 | 19 | import org.springframework.cloud.sleuth.brave.BraveTestTracing; 20 | import org.springframework.cloud.sleuth.test.TestTracingAware; 21 | 22 | /** 23 | * @author Marcin Grzejszczak 24 | */ 25 | public class TraceableScheduledExecutorServiceTest 26 | extends org.springframework.cloud.sleuth.instrument.async.TraceableScheduledExecutorServiceTest { 27 | 28 | BraveTestTracing testTracing; 29 | 30 | @Override 31 | public TestTracingAware tracerTest() { 32 | if (this.testTracing == null) { 33 | this.testTracing = new BraveTestTracing(); 34 | } 35 | return this.testTracing; 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /tests/brave/spring-cloud-sleuth-instrumentation-async-tests/src/test/resources/application.yml: -------------------------------------------------------------------------------- 1 | logging.level.org.springframework.cloud: DEBUG 2 | logging.level.com.netflix.discovery.InstanceInfoReplicator: ERROR 3 | logging.level.org.springframework.cloud.sleuth.instrument.web.client.feign: TRACE 4 | -------------------------------------------------------------------------------- /tests/brave/spring-cloud-sleuth-instrumentation-baggage-tests/src/test/resources/application.yml: -------------------------------------------------------------------------------- 1 | logging.level.org.springframework.cloud: DEBUG 2 | logging.level.com.netflix.discovery.InstanceInfoReplicator: ERROR 3 | logging.level.org.springframework.cloud.sleuth.instrument.web.client.feign: TRACE 4 | 5 | spring.autoconfigure.exclude: org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration, org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration, org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration, org.springframework.boot.autoconfigure.data.web.SpringDataWebAutoConfiguration, org.springframework.cloud.gateway.config.GatewayAutoConfiguration, org.springframework.cloud.gateway.config.GatewayClassPathWarningAutoConfiguration, org.springframework.cloud.gateway.config.GatewayMetricsAutoConfiguration 6 | -------------------------------------------------------------------------------- /tests/brave/spring-cloud-sleuth-instrumentation-batch-tests/src/test/resources/application.yml: -------------------------------------------------------------------------------- 1 | logging.level.org.springframework.cloud: DEBUG 2 | logging.level.com.netflix.discovery.InstanceInfoReplicator: ERROR 3 | logging.level.org.springframework.cloud.sleuth.instrument.web.client.feign: TRACE 4 | 5 | spring.autoconfigure.exclude: org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration, org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration, org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration, org.springframework.boot.autoconfigure.data.web.SpringDataWebAutoConfiguration 6 | -------------------------------------------------------------------------------- /tests/brave/spring-cloud-sleuth-instrumentation-circuitbreaker-reactive-tests/src/test/resources/application.yml: -------------------------------------------------------------------------------- 1 | logging.level.org.springframework.cloud: DEBUG 2 | logging.level.com.netflix.discovery.InstanceInfoReplicator: ERROR 3 | logging.level.org.springframework.cloud.sleuth.instrument.web.client.feign: TRACE 4 | 5 | spring.autoconfigure.exclude: org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration, org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration, org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration, org.springframework.boot.autoconfigure.data.web.SpringDataWebAutoConfiguration, org.springframework.cloud.gateway.config.GatewayAutoConfiguration, org.springframework.cloud.gateway.config.GatewayClassPathWarningAutoConfiguration, org.springframework.cloud.gateway.config.GatewayMetricsAutoConfiguration 6 | -------------------------------------------------------------------------------- /tests/brave/spring-cloud-sleuth-instrumentation-circuitbreaker-tests/src/test/resources/application.yml: -------------------------------------------------------------------------------- 1 | logging.level.org.springframework.cloud: DEBUG 2 | logging.level.com.netflix.discovery.InstanceInfoReplicator: ERROR 3 | logging.level.org.springframework.cloud.sleuth.instrument.web.client.feign: TRACE 4 | 5 | spring.autoconfigure.exclude: org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration, org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration, org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration, org.springframework.boot.autoconfigure.data.web.SpringDataWebAutoConfiguration, org.springframework.cloud.gateway.config.GatewayAutoConfiguration, org.springframework.cloud.gateway.config.GatewayClassPathWarningAutoConfiguration, org.springframework.cloud.gateway.config.GatewayMetricsAutoConfiguration 6 | -------------------------------------------------------------------------------- /tests/brave/spring-cloud-sleuth-instrumentation-config-server-tests/src/test/resources/application.yml: -------------------------------------------------------------------------------- 1 | logging.level.org.springframework.cloud: DEBUG 2 | 3 | spring.autoconfigure.exclude: org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration, org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration, org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration, org.springframework.boot.autoconfigure.data.web.SpringDataWebAutoConfiguration 4 | -------------------------------------------------------------------------------- /tests/brave/spring-cloud-sleuth-instrumentation-feign-tests/src/test/java/org/springframework/cloud/sleuth/brave/instrument/feign/TraceFeignAspectTests.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.cloud.sleuth.brave.instrument.feign; 18 | 19 | import org.springframework.cloud.sleuth.brave.BraveIntegrationTestTracing; 20 | import org.springframework.cloud.sleuth.brave.BraveTestTracing; 21 | import org.springframework.cloud.sleuth.test.TestTracingAware; 22 | 23 | /** 24 | * @author Marcin Grzejszczak 25 | */ 26 | public class TraceFeignAspectTests 27 | extends org.springframework.cloud.sleuth.instrument.web.client.feign.TraceFeignAspectTests { 28 | 29 | BraveTestTracing testTracing; 30 | 31 | @Override 32 | public TestTracingAware tracerTest() { 33 | if (this.testTracing == null) { 34 | this.testTracing = new BraveIntegrationTestTracing(); 35 | } 36 | return this.testTracing; 37 | } 38 | 39 | } 40 | -------------------------------------------------------------------------------- /tests/brave/spring-cloud-sleuth-instrumentation-feign-tests/src/test/resources/application.yml: -------------------------------------------------------------------------------- 1 | logging.level.org.springframework.cloud: DEBUG 2 | logging.level.com.netflix.discovery.InstanceInfoReplicator: ERROR 3 | logging.level.org.springframework.cloud.sleuth.instrument.web.client.feign: TRACE 4 | -------------------------------------------------------------------------------- /tests/brave/spring-cloud-sleuth-instrumentation-gateway-tests/src/test/java/org/springframework/cloud/sleuth/brave/instrument/web/client/TraceRequestHttpHeadersFilterTests.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.cloud.sleuth.brave.instrument.web.client; 18 | 19 | import org.springframework.cloud.sleuth.brave.BraveTestTracing; 20 | import org.springframework.cloud.sleuth.test.TestTracingAware; 21 | 22 | public class TraceRequestHttpHeadersFilterTests 23 | extends org.springframework.cloud.sleuth.instrument.web.client.TraceRequestHttpHeadersFilterTests { 24 | 25 | BraveTestTracing testTracing; 26 | 27 | @Override 28 | public TestTracingAware tracerTest() { 29 | if (this.testTracing == null) { 30 | this.testTracing = new BraveTestTracing(); 31 | } 32 | return this.testTracing; 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /tests/brave/spring-cloud-sleuth-instrumentation-gateway-tests/src/test/java/org/springframework/cloud/sleuth/brave/instrument/web/client/TraceResponseHttpHeadersFilterTests.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.cloud.sleuth.brave.instrument.web.client; 18 | 19 | import org.springframework.cloud.sleuth.brave.BraveTestTracing; 20 | import org.springframework.cloud.sleuth.test.TestTracingAware; 21 | 22 | public class TraceResponseHttpHeadersFilterTests 23 | extends org.springframework.cloud.sleuth.instrument.web.client.TraceResponseHttpHeadersFilterTests { 24 | 25 | BraveTestTracing testTracing; 26 | 27 | @Override 28 | public TestTracingAware tracerTest() { 29 | if (this.testTracing == null) { 30 | this.testTracing = new BraveTestTracing(); 31 | } 32 | return this.testTracing; 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /tests/brave/spring-cloud-sleuth-instrumentation-gateway-tests/src/test/resources/application.yml: -------------------------------------------------------------------------------- 1 | logging.level: 2 | org.springframework.cloud: TRACE 3 | reactor.netty: TRACE 4 | 5 | spring.autoconfigure.exclude: org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration, org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration, org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration, org.springframework.boot.autoconfigure.data.web.SpringDataWebAutoConfiguration, org.springframework.cloud.gateway.config.GatewayClassPathWarningAutoConfiguration, org.springframework.cloud.gateway.config.GatewayMetricsAutoConfiguration 6 | -------------------------------------------------------------------------------- /tests/brave/spring-cloud-sleuth-instrumentation-grpc-tests/src/test/java/org/springframework/cloud/sleuth/instrument/grpc/stubs/HelloReplyOrBuilder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.cloud.sleuth.instrument.grpc.stubs; 18 | 19 | public interface HelloReplyOrBuilder extends 20 | // @@protoc_insertion_point(interface_extends:sample.grpc.HelloReply) 21 | com.google.protobuf.MessageOrBuilder { 22 | 23 | /** 24 | * string message = 1; 25 | */ 26 | java.lang.String getMessage(); 27 | 28 | /** 29 | * string message = 1; 30 | */ 31 | com.google.protobuf.ByteString getMessageBytes(); 32 | 33 | } 34 | -------------------------------------------------------------------------------- /tests/brave/spring-cloud-sleuth-instrumentation-grpc-tests/src/test/java/org/springframework/cloud/sleuth/instrument/grpc/stubs/HelloRequestOrBuilder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.cloud.sleuth.instrument.grpc.stubs; 18 | 19 | public interface HelloRequestOrBuilder extends 20 | // @@protoc_insertion_point(interface_extends:sample.grpc.HelloRequest) 21 | com.google.protobuf.MessageOrBuilder { 22 | 23 | /** 24 | * string name = 1; 25 | */ 26 | java.lang.String getName(); 27 | 28 | /** 29 | * string name = 1; 30 | */ 31 | com.google.protobuf.ByteString getNameBytes(); 32 | 33 | } 34 | -------------------------------------------------------------------------------- /tests/brave/spring-cloud-sleuth-instrumentation-grpc-tests/src/test/resources/application.yml: -------------------------------------------------------------------------------- 1 | logging.level.org.springframework.cloud: DEBUG 2 | logging.level.com.netflix.discovery.InstanceInfoReplicator: ERROR 3 | logging.level.org.springframework.cloud.sleuth.instrument.web.client.feign: TRACE 4 | -------------------------------------------------------------------------------- /tests/brave/spring-cloud-sleuth-instrumentation-jdbc-tests/src/test/resources/application.yml: -------------------------------------------------------------------------------- 1 | logging.level.org.springframework.cloud: DEBUG 2 | logging.level.com.netflix.discovery.InstanceInfoReplicator: ERROR 3 | logging.level.org.springframework.cloud.sleuth.instrument.web.client.feign: TRACE 4 | 5 | spring.autoconfigure.exclude: org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration, org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration, org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration, org.springframework.boot.autoconfigure.data.web.SpringDataWebAutoConfiguration, org.springframework.cloud.gateway.config.GatewayAutoConfiguration, org.springframework.cloud.gateway.config.GatewayClassPathWarningAutoConfiguration, org.springframework.cloud.gateway.config.GatewayMetricsAutoConfiguration 6 | -------------------------------------------------------------------------------- /tests/brave/spring-cloud-sleuth-instrumentation-lettuce-tests/src/test/resources/application.yml: -------------------------------------------------------------------------------- 1 | logging.level.org.springframework.cloud: DEBUG 2 | logging.level.com.netflix.discovery.InstanceInfoReplicator: ERROR 3 | logging.level.org.springframework.cloud.sleuth.instrument.web.client.feign: TRACE 4 | -------------------------------------------------------------------------------- /tests/brave/spring-cloud-sleuth-instrumentation-messaging-tests/activemq-data/localhost/KahaDB/db.data: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-cloud/spring-cloud-sleuth/43744e8471f1629d26afafc3fa696b6b826a11a4/tests/brave/spring-cloud-sleuth-instrumentation-messaging-tests/activemq-data/localhost/KahaDB/db.data -------------------------------------------------------------------------------- /tests/brave/spring-cloud-sleuth-instrumentation-messaging-tests/activemq-data/localhost/KahaDB/db.redo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-cloud/spring-cloud-sleuth/43744e8471f1629d26afafc3fa696b6b826a11a4/tests/brave/spring-cloud-sleuth-instrumentation-messaging-tests/activemq-data/localhost/KahaDB/db.redo -------------------------------------------------------------------------------- /tests/brave/spring-cloud-sleuth-instrumentation-messaging-tests/activemq-data/localhost/KahaDB/lock: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-cloud/spring-cloud-sleuth/43744e8471f1629d26afafc3fa696b6b826a11a4/tests/brave/spring-cloud-sleuth-instrumentation-messaging-tests/activemq-data/localhost/KahaDB/lock -------------------------------------------------------------------------------- /tests/brave/spring-cloud-sleuth-instrumentation-messaging-tests/src/test/java/org/springframework/cloud/sleuth/instrument/messaging/issues/issue_943/MessagingGateway.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.cloud.sleuth.instrument.messaging.issues.issue_943; 18 | 19 | public interface MessagingGateway { 20 | 21 | void processMessage(String[] messageArray); 22 | 23 | } 24 | -------------------------------------------------------------------------------- /tests/brave/spring-cloud-sleuth-instrumentation-messaging-tests/src/test/resources/application.yml: -------------------------------------------------------------------------------- 1 | logging.level.org.springframework.cloud: DEBUG 2 | logging.level.com.netflix.discovery.InstanceInfoReplicator: ERROR 3 | logging.level.org.springframework.cloud.sleuth.instrument.web.client.feign: TRACE 4 | -------------------------------------------------------------------------------- /tests/brave/spring-cloud-sleuth-instrumentation-mongodb-tests/src/test/resources/application.yml: -------------------------------------------------------------------------------- 1 | logging.level.org.springframework.cloud: DEBUG 2 | logging.level.org.springframework.cloud.sleuth.instrument.mongodb: TRACE 3 | 4 | spring.autoconfigure.exclude: org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration, org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration, org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration, org.springframework.boot.autoconfigure.data.web.SpringDataWebAutoConfiguration, org.springframework.cloud.gateway.config.GatewayAutoConfiguration, org.springframework.cloud.gateway.config.GatewayClassPathWarningAutoConfiguration, org.springframework.cloud.gateway.config.GatewayMetricsAutoConfiguration 5 | -------------------------------------------------------------------------------- /tests/brave/spring-cloud-sleuth-instrumentation-mvc-tests/src/test/java/org/springframework/cloud/sleuth/brave/instrument/web/TraceWebDisabledTests.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.cloud.sleuth.brave.instrument.web; 18 | 19 | import org.junit.jupiter.api.Test; 20 | 21 | import org.springframework.boot.autoconfigure.EnableAutoConfiguration; 22 | import org.springframework.boot.test.context.SpringBootTest; 23 | import org.springframework.context.annotation.Configuration; 24 | 25 | /** 26 | * @author Marcin Grzejszczak 27 | */ 28 | @SpringBootTest(classes = { TraceWebDisabledTests.Config.class }, properties = { "spring.sleuth.web.enabled=false" }) 29 | public class TraceWebDisabledTests { 30 | 31 | @Test 32 | public void should_load_context() { 33 | 34 | } 35 | 36 | @Configuration(proxyBeanMethods = false) 37 | @EnableAutoConfiguration 38 | public static class Config { 39 | 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /tests/brave/spring-cloud-sleuth-instrumentation-mvc-tests/src/test/java/org/springframework/cloud/sleuth/brave/instrument/web/client/TraceRestTemplateInterceptorIntegrationTests.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.cloud.sleuth.brave.instrument.web.client; 18 | 19 | import org.springframework.cloud.sleuth.brave.BraveTestTracing; 20 | import org.springframework.cloud.sleuth.test.TestTracingAware; 21 | 22 | /** 23 | * @author Marcin Grzejszczak 24 | */ 25 | public class TraceRestTemplateInterceptorIntegrationTests 26 | extends org.springframework.cloud.sleuth.instrument.web.client.TraceRestTemplateInterceptorIntegrationTests { 27 | 28 | BraveTestTracing testTracing; 29 | 30 | @Override 31 | public TestTracingAware tracerTest() { 32 | if (this.testTracing == null) { 33 | this.testTracing = new BraveTestTracing(); 34 | } 35 | return this.testTracing; 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /tests/brave/spring-cloud-sleuth-instrumentation-mvc-tests/src/test/resources/application.yml: -------------------------------------------------------------------------------- 1 | logging.level.org.springframework.cloud: DEBUG 2 | logging.level.com.netflix.discovery.InstanceInfoReplicator: ERROR 3 | logging.level.org.springframework.cloud.sleuth.instrument.web.client.feign: TRACE 4 | -------------------------------------------------------------------------------- /tests/brave/spring-cloud-sleuth-instrumentation-quartz-tests/src/test/java/org/springframework/cloud/sleuth/brave/instrument/quartz/TracingJobListenerTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.cloud.sleuth.brave.instrument.quartz; 18 | 19 | import org.springframework.cloud.sleuth.brave.BraveIntegrationTestTracing; 20 | import org.springframework.cloud.sleuth.brave.BraveTestTracing; 21 | import org.springframework.cloud.sleuth.test.TestTracingAware; 22 | 23 | public class TracingJobListenerTest extends org.springframework.cloud.sleuth.instrument.quartz.TracingJobListenerTest { 24 | 25 | BraveTestTracing testTracing; 26 | 27 | @Override 28 | public TestTracingAware tracerTest() { 29 | if (this.testTracing == null) { 30 | this.testTracing = new BraveIntegrationTestTracing(); 31 | } 32 | return this.testTracing; 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /tests/brave/spring-cloud-sleuth-instrumentation-quartz-tests/src/test/resources/application.yml: -------------------------------------------------------------------------------- 1 | logging.level.org.springframework.cloud: DEBUG 2 | logging.level.com.netflix.discovery.InstanceInfoReplicator: ERROR 3 | logging.level.org.springframework.cloud.sleuth.instrument.web.client.feign: TRACE 4 | 5 | spring.autoconfigure.exclude: org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration, org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration, org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration, org.springframework.boot.autoconfigure.data.web.SpringDataWebAutoConfiguration, org.springframework.cloud.gateway.config.GatewayAutoConfiguration, org.springframework.cloud.gateway.config.GatewayClassPathWarningAutoConfiguration, org.springframework.cloud.gateway.config.GatewayMetricsAutoConfiguration 6 | -------------------------------------------------------------------------------- /tests/brave/spring-cloud-sleuth-instrumentation-r2dbc-tests/src/test/resources/application.yml: -------------------------------------------------------------------------------- 1 | logging.level.org.springframework.cloud: TRACE 2 | -------------------------------------------------------------------------------- /tests/brave/spring-cloud-sleuth-instrumentation-reactor-tests/src/test/resources/application.yml: -------------------------------------------------------------------------------- 1 | logging.level.org.springframework.cloud: DEBUG 2 | logging.level.org.springframework.cloud.sleuth.autoconfig.instrument.reactor: TRACE 3 | logging.level.com.netflix.discovery.InstanceInfoReplicator: ERROR 4 | logging.level.org.springframework.cloud.sleuth.instrument.web.client.feign: TRACE 5 | -------------------------------------------------------------------------------- /tests/brave/spring-cloud-sleuth-instrumentation-rxjava-tests/src/test/resources/application.yml: -------------------------------------------------------------------------------- 1 | logging.level.org.springframework.cloud: DEBUG 2 | logging.level.com.netflix.discovery.InstanceInfoReplicator: ERROR 3 | logging.level.org.springframework.cloud.sleuth.instrument.web.client.feign: TRACE 4 | 5 | # comma separated list of matchers 6 | spring.sleuth.rxjava.schedulers.ignoredthreads: HystixMetricPoller,^MyCustomThread.*$,^RxComputation.*$ 7 | -------------------------------------------------------------------------------- /tests/brave/spring-cloud-sleuth-instrumentation-scheduling-tests/src/test/resources/application.yml: -------------------------------------------------------------------------------- 1 | logging.level.org.springframework.cloud: DEBUG 2 | logging.level.com.netflix.discovery.InstanceInfoReplicator: ERROR 3 | logging.level.org.springframework.cloud.sleuth.instrument.web.client.feign: TRACE 4 | 5 | spring.sleuth.scheduled.skipPattern: "^org.*TestBeanWithScheduledMethodToBeIgnored$" 6 | -------------------------------------------------------------------------------- /tests/brave/spring-cloud-sleuth-instrumentation-security-tests/src/test/resources/application.yml: -------------------------------------------------------------------------------- 1 | spring.application.name: spring-security-test-app 2 | 3 | #logging.level.org.springframework.security: TRACE 4 | -------------------------------------------------------------------------------- /tests/brave/spring-cloud-sleuth-instrumentation-task-tests/src/test/resources/application.yml: -------------------------------------------------------------------------------- 1 | logging.level.org.springframework.cloud: DEBUG 2 | -------------------------------------------------------------------------------- /tests/brave/spring-cloud-sleuth-instrumentation-webflux-tests/src/test/java/org/springframework/cloud/sleuth/brave/instrument/web/client/HttpClientBeanPostProcessorTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.cloud.sleuth.brave.instrument.web.client; 18 | 19 | import org.springframework.cloud.sleuth.TraceContext; 20 | import org.springframework.cloud.sleuth.brave.bridge.BraveAccessor; 21 | 22 | public class HttpClientBeanPostProcessorTest 23 | extends org.springframework.cloud.sleuth.instrument.web.client.HttpClientBeanPostProcessorTest { 24 | 25 | @Override 26 | public TraceContext traceContext() { 27 | return BraveAccessor 28 | .traceContext(brave.propagation.TraceContext.newBuilder().traceId(1).spanId(2).sampled(true).build()); 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /tests/brave/spring-cloud-sleuth-zipkin-tests/src/test/java/org/springframework/cloud/sleuth/autoconfig/zipkin2/BraveDefaultEndpointLocatorConfigurationTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.cloud.sleuth.autoconfig.zipkin2; 18 | 19 | /** 20 | * @author Matcin Wielgus 21 | */ 22 | public class BraveDefaultEndpointLocatorConfigurationTest extends DefaultEndpointLocatorConfigurationTest { 23 | 24 | } 25 | -------------------------------------------------------------------------------- /tests/brave/spring-cloud-sleuth-zipkin-tests/src/test/resources/application.yml: -------------------------------------------------------------------------------- 1 | logging.level.org.springframework.cloud: DEBUG 2 | logging.level.com.netflix.discovery.InstanceInfoReplicator: ERROR 3 | logging.level.org.springframework.cloud.sleuth.instrument.web.client.feign: TRACE 4 | 5 | spring.autoconfigure.exclude: org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration, org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration, org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration, org.springframework.boot.autoconfigure.data.web.SpringDataWebAutoConfiguration, org.springframework.cloud.gateway.config.GatewayAutoConfiguration, org.springframework.cloud.gateway.config.GatewayClassPathWarningAutoConfiguration, org.springframework.cloud.gateway.config.GatewayMetricsAutoConfiguration 6 | -------------------------------------------------------------------------------- /tests/common/src/main/java/org/springframework/cloud/sleuth/brave/BraveTestTracingAssertions.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.cloud.sleuth.brave; 18 | 19 | import org.assertj.core.api.BDDAssertions; 20 | 21 | import org.springframework.cloud.sleuth.exporter.FinishedSpan; 22 | import org.springframework.cloud.sleuth.test.TestTracingAssertions; 23 | 24 | public class BraveTestTracingAssertions implements TestTracingAssertions { 25 | 26 | @Override 27 | public void assertThatNoParentPresent(FinishedSpan finishedSpan) { 28 | BDDAssertions.then(finishedSpan.getParentId()).isNull(); 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /tests/common/src/main/java/org/springframework/cloud/sleuth/instrument/r2dbc/ReactiveCustomerRepository.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.cloud.sleuth.instrument.r2dbc; 18 | 19 | import reactor.core.publisher.Flux; 20 | import reactor.core.publisher.Mono; 21 | 22 | import org.springframework.data.repository.reactive.ReactiveCrudRepository; 23 | 24 | public interface ReactiveCustomerRepository extends ReactiveCrudRepository { 25 | 26 | Flux findByLastName(String lastName); 27 | 28 | Mono findById(long id); 29 | 30 | } 31 | -------------------------------------------------------------------------------- /tests/common/src/main/java/org/springframework/cloud/sleuth/internal/SleuthContextListenerAccessor.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.cloud.sleuth.internal; 18 | 19 | import java.util.concurrent.atomic.AtomicBoolean; 20 | 21 | import org.springframework.beans.factory.BeanFactory; 22 | 23 | public final class SleuthContextListenerAccessor { 24 | 25 | private SleuthContextListenerAccessor() { 26 | throw new IllegalStateException("Can't instantiate a utility class"); 27 | } 28 | 29 | public static void set(BeanFactory beanFactory, boolean refreshed) { 30 | SleuthContextListener.CACHE.put(beanFactory.hashCode(), 31 | new SleuthContextListener(new AtomicBoolean(refreshed), new AtomicBoolean(false))); 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /tests/common/src/main/java/org/springframework/cloud/sleuth/test/TestTracingAssertions.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.cloud.sleuth.test; 18 | 19 | import org.springframework.cloud.sleuth.exporter.FinishedSpan; 20 | 21 | public interface TestTracingAssertions { 22 | 23 | void assertThatNoParentPresent(FinishedSpan finishedSpan); 24 | 25 | default String or128Bit(String id) { 26 | return id; 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /tests/common/src/main/java/org/springframework/cloud/sleuth/test/TestTracingAware.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.cloud.sleuth.test; 18 | 19 | import java.io.Closeable; 20 | 21 | public interface TestTracingAware extends Closeable { 22 | 23 | TracerAware tracing(); 24 | 25 | TestSpanHandler handler(); 26 | 27 | TestTracingAssertions assertions(); 28 | 29 | @Override 30 | void close(); 31 | 32 | } 33 | -------------------------------------------------------------------------------- /tests/common/src/main/java/org/springframework/cloud/sleuth/test/TestTracingAwareSupplier.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.cloud.sleuth.test; 18 | 19 | import org.junit.jupiter.api.AfterEach; 20 | 21 | public interface TestTracingAwareSupplier { 22 | 23 | TestTracingAware tracerTest(); 24 | 25 | @AfterEach 26 | default void cleanUpTracing() { 27 | tracerTest().close(); 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /tests/common/src/main/resources/schema.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE reactive_customer (id SERIAL PRIMARY KEY, first_name VARCHAR(255), last_name VARCHAR(255)); 2 | -------------------------------------------------------------------------------- /tests/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 23 | 4.0.0 24 | 25 | spring-cloud-sleuth-tests 26 | pom 27 | Spring Cloud Sleuth Tests 28 | Spring Cloud Sleuth Tests 29 | 30 | 31 | org.springframework.cloud 32 | spring-cloud-sleuth 33 | 3.1.11-SNAPSHOT 34 | .. 35 | 36 | 37 | 38 | common 39 | brave 40 | 41 | 42 | 43 | --------------------------------------------------------------------------------