Commit Graph

449 Commits

Author SHA1 Message Date
buildmaster
4b5bd34bbc Update SNAPSHOT to 3.0.0-M5 2020-11-17 21:04:48 +00:00
Marcin Grzejszczak
6e306e594d Abstract tracer implementations via an API (#1757)
Spring Cloud Sleuth currently is an autoconfiguration over Brave. It also consists of various instrumentation mechanisms for libraries that are not supported by Brave (e.g. Spring Cloud Circuitbreaker).

We would like to abstract Brave so that Spring Cloud Sleuth becomes an autoconfiguration for any tracer implementation that is compatible with Spring Cloud Sleuth. That way Spring Cloud Sleuth in its core module would consist of an API and various tracer implementations would implement that API which would also allow automatic instrumentation of libraries that are supported by Spring Cloud Sleuth.

## OpenTelemetry Support

Thanks to doing this abstraction we are able to support new tracer implementations, not only Brave. We've decided to add support for the OpenTelemetry SDK as the second one. If in the future if we decide to add new tracers then it will be just a matter of adding a new module that bridges to the Spring Cloud Sleuth one. Thanks to abstraction of tests as well we will be easily able to plug that tracer mechanism into our current suite of tests.
2020-10-23 08:50:23 +02:00
buildmaster
f6608cd27f Going back to snapshots 2020-10-03 14:19:22 +00:00
buildmaster
bc5668b96d Update SNAPSHOT to 3.0.0-M4 2020-10-03 14:18:00 +00:00
dependabot-preview[bot]
b919bc06bb Bump animal-sniffer-maven-plugin from 1.18 to 1.19 (#1747)
Bumps [animal-sniffer-maven-plugin](https://github.com/mojohaus/animal-sniffer) from 1.18 to 1.19.
- [Release notes](https://github.com/mojohaus/animal-sniffer/releases)
- [Commits](https://github.com/mojohaus/animal-sniffer/compare/animal-sniffer-parent-1.18...animal-sniffer-parent-1.19)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-10-01 11:52:52 +02:00
buildmaster
05461159eb Bumping versions 2020-09-17 05:29:17 +00:00
dependabot-preview[bot]
d38a5d986a Bump hamcrest-core from 1.3 to 2.2 (#1706)
Bumps [hamcrest-core](https://github.com/hamcrest/JavaHamcrest) from 1.3 to 2.2.
- [Release notes](https://github.com/hamcrest/JavaHamcrest/releases)
- [Changelog](https://github.com/hamcrest/JavaHamcrest/blob/master/CHANGES.md)
- [Commits](https://github.com/hamcrest/JavaHamcrest/compare/hamcrest-java-1.3...v2.2)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-08-05 17:38:30 +02:00
buildmaster
dca561e4e8 Going back to snapshots 2020-07-23 18:49:08 +00:00
buildmaster
f352801918 Update SNAPSHOT to 3.0.0-M3 2020-07-23 18:47:48 +00:00
Marcin Grzejszczak
bd149ce4a7 Improvement with Reactor instrumentation
- adds Spring Cloud Function instrumentation
- adds Operators to manually provide instrumentation for Fluxes
- introduces Manual instrumentation mode for Reactor

TODO: Documentation (will add it soon)

related gh-1684
2020-07-21 19:06:55 +02:00
buildmaster
93ea0d6b00 Going back to snapshots 2020-05-29 19:03:35 +00:00
buildmaster
640faa7c30 Update SNAPSHOT to 3.0.0-M2 2020-05-29 19:02:42 +00:00
Adrian Cole
3da9de053e Merge branch '2.2.x' 2020-05-18 20:20:40 +08:00
Adrian Cole
40785d642a Removes Zipkin dependency from all tests (#1645)
Brave's SpanHandler can report natively in other formats which have different
constraints than Zipkin and often extensions to the data model.

This change ports all tests away from Zipkin's types so that it is more clear
what's actually recorded vs what's a side-effect of Zipkin conversion.

This removes `BlockingQueueSpanReporter` which was never released, also.
2020-05-18 17:02:29 +08:00
Adrian Cole
8ae5e13d31 Merge branch '2.2.x' 2020-05-16 15:15:37 +08:00
Adrian Cole
b1d39ce291 Updates to Brave 5.12 and introduces SpanHandler (#1632)
`SpanHandler` is the base type for the now deprecated `FinishedSpanHandler`.

Notable, it can not just handle things at the end of a recording, but also the
beginning.

For example, this permits set-once baggage without the HTTP abstraction:
```java
static final BaggageField EPOCH_SECONDS = BaggageField.create("epoch_seconds");

static final class RootOnlyBaggage extends SpanHandler {
  @Override
  public boolean begin(TraceContext context, MutableSpan span, @Nullable TraceContext parent) {
    if (EPOCH_SECONDS.getValue(context) == null) { // only set at the first span
      long epochSeconds = System.currentTimeMillis() / 1000;
      EPOCH_SECONDS.updateValue(context, String.valueOf(epochSeconds));
    }
    return true;
  }

  @Override public boolean end(TraceContext context, MutableSpan span, Cause cause) {
    Tags.BAGGAGE_FIELD.tag(EPOCH_SECONDS, context, span);
    return true;
  }
}
```

As the parent is available, it can also facilitate advanced tasks like counting
children, or summarizing entire local roots.

See https://github.com/openzipkin/brave/tree/master/brave/src/test/java/brave/features/handler
and https://github.com/openzipkin/brave/blob/master/brave/src/main/java/brave/handler/SpanHandler.java for more
2020-05-16 14:01:38 +08:00
buildmaster
d41d75a3eb Bumping versions 2020-04-17 14:53:39 +00:00
buildmaster
08a575141d Going back to snapshots 2020-04-09 22:48:15 +00:00
buildmaster
66b540f0b9 Update SNAPSHOT to 3.0.0.M1 2020-04-09 22:47:21 +00:00
Adrian Cole
b92db4ce51 Stops propagating Sleuth 1.x spring-messaging headers
To reduce confusion and overhead, the following custom spring-messaging headers added in Sleuth 1.0 are no longer sent, and a log warning is issued once if they are by outside code.

* spanId
* spanSampled
* spanParentSpanId
* spanTraceId
* spanFlags

Sending the above headers actually increases the headers by up to 10 because they are duplicated in the "native" part of messages. This overhead is extreme especially if messages never leave the process.

The solution is to only send [b3 single format](https://github.com/openzipkin/b3-propagation#single-header), which has been in sleuth since 2.0 and is compatible with JMS. The B3 single format is always parsed and takes precedence, even if multiple headers are sent, so this is a safe change.

Note: Unlike RPC, messaging spans never join with their parent. Better performance is achieved by not propagating the producer's parentId downstream.

Note: Deprecated spring-messaging headers such "spanTraceId" as are still read in Sleuth 3.x. However, they will not be at some point in the future. Please pay attention to the log messages and update your code if you are accidentally using them.
2020-04-07 10:58:49 +08:00
Adrian Cole
5e1f7f9c0c Merge branch '2.2.x' 2020-04-04 14:39:36 +08:00
buildmaster
2674fba171 Bumping versions to 2.2.3.BUILD-SNAPSHOT after release 2020-03-04 16:59:42 +00:00
buildmaster
5dd714da5c Going back to snapshots 2020-03-04 16:59:42 +00:00
buildmaster
151218b30a Update SNAPSHOT to 2.2.2.RELEASE 2020-03-04 16:57:41 +00:00
Marcin Grzejszczak
3ce018bc51 Upgrades to JUnit5; fixes gh-1567 2020-03-03 19:53:57 +01:00
Marcin Grzejszczak
a59bfb00cf Merge branch '2.2.x' 2020-03-03 19:44:56 +01:00
Adrian Cole
eec55b9a6c Adds wiring for HttpRequestParser and HttpResponseParser (#1575) 2020-03-02 09:12:47 +08:00
Marcin Grzejszczak
0d237b564f Removed deprecated apis; fixes gh-1564 2020-02-18 13:30:00 +01:00
Marcin Grzejszczak
3813cf9dd4 Removes modules in maintenance more.
Zuul, ribbon and hystrix
2020-02-12 11:03:04 +01:00
Adrian Cole
fe2591b22a latest brave 2020-01-29 14:06:10 +08:00
Adrian Cole
163532fd8a latest brave 2020-01-29 14:05:46 +08:00
Adrian Cole
8a4002d288 Cleanups of build including upgrade of Brave (#1530)
In efforts to dig deep into benchmarks, I noticed we were a bit out of
date on Brave. Then, noticed some other artifacts could be bumped
safely. Finally, a find/replace on http/https was over zealous and
tripped up XML.

One change to test expectations and Brave is explained here:
https://github.com/openzipkin/brave/blob/master/instrumentation/RATIONALE.md#calling-spanfinish-while-the-context-is-in-scope
2020-01-22 19:31:50 +08:00
Adrian Cole
8866b84906 Cleanups of build including upgrade of Brave (#1530)
In efforts to dig deep into benchmarks, I noticed we were a bit out of
date on Brave. Then, noticed some other artifacts could be bumped
safely. Finally, a find/replace on http/https was over zealous and
tripped up XML.

One change to test expectations and Brave is explained here:
https://github.com/openzipkin/brave/blob/master/instrumentation/RATIONALE.md#calling-spanfinish-while-the-context-is-in-scope
2020-01-21 09:44:08 +01:00
Adrian Cole
58a956b29a Addresses Spring Boot 2.3 drift (#1527) 2020-01-20 16:42:17 +08:00
buildmaster
1c4a3da588 Bumping versions to 2.2.2.BUILD-SNAPSHOT after release 2019-12-20 13:48:43 +00:00
buildmaster
ac6dff3407 Going back to snapshots 2019-12-20 13:48:43 +00:00
buildmaster
c71d6ff0e2 Update SNAPSHOT to 2.2.1.RELEASE 2019-12-20 13:46:45 +00:00
buildmaster
9ca94951ec Bumping versions to 2.2.1.BUILD-SNAPSHOT after release 2019-11-26 10:35:52 +00:00
buildmaster
830f300ca9 Going back to snapshots 2019-11-26 10:35:52 +00:00
buildmaster
312f87cd23 Update SNAPSHOT to 2.2.0.RELEASE 2019-11-26 10:34:27 +00:00
buildmaster
99ebccf97c Going back to snapshots 2019-11-10 00:19:36 +00:00
buildmaster
10e6f9a705 Update SNAPSHOT to 2.2.0.RC2 2019-11-10 00:18:38 +00:00
buildmaster
b4b597872f Going back to snapshots 2019-10-24 21:05:59 +00:00
buildmaster
d972a87338 Update SNAPSHOT to 2.2.0.RC1 2019-10-24 21:05:02 +00:00
buildmaster
9361cf2017 Going back to snapshots 2019-10-03 20:06:35 +00:00
buildmaster
365a1c60f0 Update SNAPSHOT to 2.2.0.M3 2019-10-03 20:05:37 +00:00
Adrian Cole
be5fa04118 Updates to latest Sampling infrastructure (#1456)
* 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();
}
```
2019-10-03 12:21:56 +02:00
Marcin Grzejszczak
0cf9003ae9 Merge branch '2.1.x' 2019-08-30 15:35:34 +02:00
Marcin Grzejszczak
dc4165ffe3 Not fails the context startup when web is disabled; fixes gh-1435 2019-08-30 15:24:41 +02:00
buildmaster
40a5333e56 Going back to snapshots 2019-08-14 15:47:10 +00:00