Added spanHandler that skips span name via patterns; fixes gh-1720

This commit is contained in:
Marcin Grzejszczak
2020-08-27 16:32:53 +02:00
parent f252a6f3ae
commit 368eabb412
5 changed files with 291 additions and 6 deletions

View File

@@ -381,12 +381,12 @@ anything not already done by Sleuth with auto-configuration or properties.
If you define one of the following as a `Bean`, Sleuth will invoke it to
customize behaviour:
* RpcTracingCustomizer - for RPC tagging and sampling policy
* HttpTracingCustomizer - for HTTP tagging and sampling policy
* MessagingTracingCustomizer - for messaging tagging and sampling policy
* CurrentTraceContextCustomizer - to integrate decorators such as correlation.
* BaggagePropagationCustomizer - for propagating baggage fields in process and over headers
* CorrelationScopeDecoratorCustomizer - for scope decorations such as MDC (logging) field correlation
* `RpcTracingCustomizer` - for RPC tagging and sampling policy
* `HttpTracingCustomizer` - for HTTP tagging and sampling policy
* `MessagingTracingCustomizer` - for messaging tagging and sampling policy
* `CurrentTraceContextCustomizer` - to integrate decorators such as correlation.
* `BaggagePropagationCustomize`r - for propagating baggage fields in process and over headers
* `CorrelationScopeDecoratorCustomizer` - for scope decorations such as MDC (logging) field correlation
=== HTTP
@@ -540,6 +540,8 @@ include::{project-root}//spring-cloud-sleuth-core/src/test/java/org/springframew
The preceding example results in changing the name of the reported span to `foo bar`, just before it gets reported (for example, to Zipkin).
Sleuth registers a `SpanHandler` bean that can automatically skip reporting spans of given name patterns. The property `spring.sleuth.span-handler.span-name-patterns-to-skip` contains the default skip patterns for span names. The property `spring.sleuth.span-handler.additional-span-name-patterns-to-skip` will append the provided span name patterns to the existing ones. In order to disable this functionality just set `spring.sleuth.span-handler.enabled` to `false`.
=== Host Locator
IMPORTANT: This section is about defining *host* from service discovery.