Renames spring.sleuth.propagation-keys to remote-keys (#1604)

spring.sleuth.local-keys and spring.sleuth.remote-keys make sense
together, especially as baggage-keys will be removed.
This commit is contained in:
Adrian Cole
2020-04-06 18:06:40 +08:00
committed by GitHub
parent 9cea092b9e
commit 3ac524c7e3
9 changed files with 76 additions and 75 deletions

View File

@@ -16,7 +16,7 @@
|spring.sleuth.integration.enabled | true | Enable Spring Integration sleuth instrumentation.
|spring.sleuth.integration.patterns | [!hystrixStreamOutput*, *, !channel*] | An array of patterns against which channel names will be matched. @see org.springframework.integration.config.GlobalChannelInterceptor#patterns() Defaults to any channel name not matching the Hystrix Stream and functional Stream channel names.
|spring.sleuth.integration.websockets.enabled | true | Enable tracing for WebSockets.
|spring.sleuth.local-keys | | Same as {@link #propagationKeys} except that this field is not propagated to remote services. @see brave.propagation.ExtraFieldPropagation.FactoryBuilder#addRedactedField(String)
|spring.sleuth.local-keys | | Same as {@link #remoteKeys} except that this field is not propagated to remote services. @see brave.baggage.BaggagePropagationConfig.SingleBaggageField#local(BaggageField)
|spring.sleuth.log.slf4j.enabled | true | Enable a {@link Slf4jScopeDecorator} that prints tracing information in the logs.
|spring.sleuth.log.slf4j.whitelisted-mdc-keys | | A list of keys to be put from baggage to MDC.
|spring.sleuth.messaging.enabled | false | Should messaging be turned on.
@@ -28,7 +28,7 @@
|spring.sleuth.messaging.rabbit.enabled | true | Enable tracing of RabbitMQ.
|spring.sleuth.messaging.rabbit.remote-service-name | rabbitmq |
|spring.sleuth.opentracing.enabled | true |
|spring.sleuth.propagation-keys | | List of fields that are referenced the same in-process as it is on the wire. For example, the name "x-vcap-request-id" would be set as-is including the prefix. <p> Note: {@code fieldName} will be implicitly lower-cased. @see brave.propagation.ExtraFieldPropagation.FactoryBuilder#addField(String)
|spring.sleuth.remote-keys | | List of fields that are referenced the same in-process as it is on the wire. For example, the name "x-vcap-request-id" would be set as-is including the prefix. <p> Note: {@code fieldName} will be implicitly lower-cased. @see brave.baggage.BaggagePropagationConfig.SingleBaggageField#remote(BaggageField)
|spring.sleuth.propagation.tag.enabled | true | Enables a {@link TagPropagationFinishedSpanHandler} that adds extra propagated fields to span tags.
|spring.sleuth.propagation.tag.whitelisted-keys | | A list of keys to be put from extra propagation fields to span tags.
|spring.sleuth.reactor.decorate-on-each | true | When true decorates on each operator, will be less performing, but logging will always contain the tracing entries in each operator. When false decorates on last operator, will be more performing, but logging might not always contain the tracing entries.

View File

@@ -88,13 +88,14 @@ In order to use the rate-limited sampler set the `spring.sleuth.sampler.rate` pr
== Baggage
With the `spring.sleuth.baggage-keys`, you set keys that get prefixed with `baggage-` for HTTP calls and `baggage_` for messaging.
You can also use the `spring.sleuth.propagation-keys` property to pass a list of prefixed keys that are propagated to remote services without any prefix.
You can also use the `spring.sleuth.remote-keys` property to pass a list of prefixed keys that are propagated to remote services without any prefix.
You can also use the `spring.sleuth.local-keys` property to pass a list keys that will be propagated locally but will not be propagated over the wire.
Notice that there's no `x-` in front of the header keys.
In order to automatically set the baggage values to Slf4j's MDC, you have to set
the `spring.sleuth.log.slf4j.whitelisted-mdc-keys` property with a list of whitelisted
baggage and propagation keys. E.g. `spring.sleuth.log.slf4j.whitelisted-mdc-keys=foo` will set the value of the `foo` baggage into MDC.
local or remote keys. E.g. `spring.sleuth.log.slf4j.whitelisted-mdc-keys=country-code` will set the
value of the `country-code` baggage into MDC.
IMPORTANT: Remember that adding entries to MDC can drastically decrease the performance of your application!