* Adds the possibility to opt-out of executor decoration
Recently, `AsyncAutoConfiguration` auto-instruments executors. This
causes spans named 'async' with no tag or other metadata to help
understand what is happening. It was somewhat difficult troubleshooting
this because the control is by bean name, but for example the "async"
span doesn't include the bean name.
See https://github.com/spring-cloud/spring-cloud-gcp/issues/1978
* Updates to latest Sampling infrastructure
Brave recently switched to an interface model for higher level sampling
like HTTP. So, `HttpSampler` -> `SamplingFunction<HttpRequest>`. Don't
worry because `HttpSampler` was retrofitted as a `SamplingFunction`.
This change moves to the higher interface, avoiding deprecated methods
and such. More interestingly, this weaves in support for `RpcTracing`,
which *finally* introduces RPC sampling the same way. Specifically, this
adds `SamplingFunction<RpcRequest>` under the same conventions as HTTP.
Most immediately, this can be used here in gRPC and Dubbo, as
autoconfiguration exists. It also works with any autoconfiguration that
isn't here, such as Armeria.
Ex. Here's a sampler that traces 100 "GetUserToken" requests per second. This
doesn't start new traces for requests to the health check service. Other
requests will use a global rate provided by the tracing component.
```java
import static brave.rpc.RpcRequestMatchers.methodEquals;
import static brave.rpc.RpcRequestMatchers.serviceEquals;
import static brave.sampler.Matchers.and;
--snip--
@Bean(name = ServerSampler.NAME)
SamplerFunction<RpcRequest> myRpcSampler() {
Matcher<RpcRequest> userAuth = and(
serviceEquals("users.UserService"),
methodEquals("GetUserToken")
);
return RpcRuleSampler.newBuilder()
.putRule(serviceEquals("grpc.health.v1.Health"), Sampler.NEVER_SAMPLE)
.putRule(userAuth, RateLimitingSampler.create(100)).build();
}
```
Changes verification in TraceAutoConfiguration.sleuthPropagation()
to not skip customization if at least one ExtraFieldCustomizer is
defined.
Without this fix the customizers are only applied when either
baggage-keys or propagation-keys property is defined.
Fixes gh-1454
without this change there was a propagation gap due to additional quotes in the headers
with this change we're wrapping the DefaultKafkaHeaderMapper to not add additional quotes
fixes gh-1430
without this change when ReflectionUtils are having a problem with accessing method (cause it's private), an exception is thrown and wrapping of an executor will not take place
with this change we catch such an exception and ignore it
related to gh-1453
without this change we're reusing the same broker for application logic and sending spans to zipkin
with this change we're adding a property to allow providing a different set of addresses for brokers to send spans to Zipkin
fixes gh-1210