Commit Graph

598 Commits

Author SHA1 Message Date
Jay Bryant
b7eb3b85b6 Wording changes (#1685)
Replacing some terms
2020-07-14 11:48:24 +02:00
buildmaster
916e52cb8d Bumping versions 2020-06-30 05:29:04 +00:00
Marcin Grzejszczak
3f9cd51313 Upload sources 2020-06-08 17:58:09 +02:00
Marcin Grzejszczak
aaea1db859 Updated props 2020-06-08 17:52:19 +02:00
Marcin Grzejszczak
ebec54e5b1 Changed packaging to jar 2020-06-08 17:12:28 +02:00
Marcin Grzejszczak
0ce00291b6 Updated adocs 2020-06-04 15:52:32 +02:00
Saisurya Kattamuri
6112b86ab7 Fix incorrect properties used in baggage section (#1662) 2020-06-03 14:36:28 +08:00
Marcin Grzejszczak
dde56c766d Merge branch '2.2.x' 2020-06-02 11:05:13 +02:00
Marcin Grzejszczak
bcb16d5341 Updated gradle example 2020-06-02 11:04:42 +02:00
Marcin Grzejszczak
b54565d32e Updated bom for dependency management
fixes gh-1658
2020-06-02 11:00:25 +02:00
Marcin Grzejszczak
ba73aa03d4 Updated links 2020-06-01 14:42:30 +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
buildmaster
2a29a23f95 Bumping versions 2020-05-29 05:29:12 +00:00
buildmaster
6b8dd82346 Bumping versions to 2.2.4.BUILD-SNAPSHOT after release 2020-05-28 20:00:54 +00:00
buildmaster
4b961dcdf3 Going back to snapshots 2020-05-28 20:00:54 +00:00
buildmaster
fdf4c647df Update SNAPSHOT to 2.2.3.RELEASE 2020-05-28 19:57:31 +00:00
buildmaster
7ecf64a607 Bumping versions 2020-05-27 05:29:15 +00:00
Marcin Grzejszczak
8752a7b8be Setting up repository for docs.spring.io migration 2020-05-25 14:40:16 +02:00
Marcin Grzejszczak
804f0cba7b Setting up repository for docs.spring.io migration 2020-05-25 13:42:59 +02:00
buildmaster
31c1bbbf9b Bumping versions 2020-05-19 05:31:39 +00:00
buildmaster
1f71925445 Bumping versions 2020-05-18 05:30:42 +00: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
a4fbdd3e47 Bumping versions 2020-05-09 05:28:53 +00:00
Adrian Cole
6fb92a5f66 Merge branch '2.2.x' 2020-04-23 19:42:38 +08:00
Adrian Cole
eac2733c8c Restores special case that ignores sampling properties (#1619)
Sleuth is unlike most tracing configuration libraries, as it has a
legacy from 1.x as being primarily log correlation. In short, when
Zipkin is not installed, it ignored the sampling properties. This
behavior was managed implicitly through an untested combination of
configuration conventions between the core and zipkin modules.

16fb8e3 broke this and this change puts it back, in a way not tightly
coupled to Zipkin and neither requires the more simple, but confusing
"import SamplerAutoConfiguration" approach. It also backfills tests
that should have broken earlier.

In practice, a site that only uses logging is likely uniform in that, so
whether or not the sampled bit is set is of no consequence. However,
there's a chance that someone might rely on this historical behavior.

We should follow-up on 3.0 and remove this as it is very unintuitive to
intentionally ignore sampling properties. For now, this restores the old
behavior based on heuristics of bean definitions.
2020-04-23 13:09:28 +08:00
buildmaster
d41d75a3eb Bumping versions 2020-04-17 14:53:39 +00:00
Adrian Cole
07baf87bdf Don't talk too much in the feature intro 2020-04-15 13:12:45 +08:00
Adrian Cole
354142e725 fixes broken link 2020-04-15 09:12:48 +08: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
1d9bcbad4f typo 2020-04-09 22:29:44 +08:00
Adrian Cole
da33366d8a fix indent 2020-04-09 22:12:24 +08:00
Adrian Cole
a4a33dec6f polish 2020-04-09 22:01:45 +08:00
Adrian Cole
5e3ab4bc94 locally sourced, organic log config 2020-04-09 21:28:59 +08:00
Adrian Cole
3e809f0ba1 attempt to fix numbers 2020-04-09 20:58:20 +08:00
Adrian Cole
d4472fb0f0 fix bad link 2020-04-09 19:45:56 +08:00
Adrian Cole
8bcffe6f0b Overhauls documentation to focus on what sleuth does (#1614)
While some overview is important, the direct implementation details of tracing
not only drifted since Sleuth 1.x, but also caused a complaint #1466

This deletes most documentation that applies to an abstraction lower than sleuth
and reworks existing docs to focus on features it enables. By doing so, we have
less to maintain and users will have a clearer idea about the relationship
between Sleuth, Zipkin and Brave. Also important is this uses updated screen
shots and is in general less cluttered than before.

Note: the relationship between Sleuth and Brave was already redone in #1603
Note: this also removes the pws app which is usually broken or out of date.

Fixes #1466
2020-04-09 19:38:48 +08:00
Adrian Cole
01e0c97838 doc drift 2020-04-07 08:54:40 +08:00
Adrian Cole
44a7f4b7ad Reorganizes code under o.s.c.sleuth.baggage
This moves code and properties under org.springframework.cloud.sleuth.baggage
Properties are now under "spring.sleuth.baggage"

Those coming from 2.x should migrate with the following:
 * spring.sleuth.baggage-keys -> `BaggagePropagationCustomizer`
 * spring.sleuth.local-keys -> spring.sleuth.baggage.local-fields
 * spring.sleuth.propagation-keys -> spring.sleuth.baggage.remote-fields
 * spring.sleuth.propagation.tag.whitelisted-keys -> spring.sleuth.baggage.tag-fields
 * spring.sleuth.log.slf4j.whitelisted-mdc-keys -> spring.sleuth.baggage.correlation-fields
 * spring.sleuth.log.slf4j.enabled -> spring.sleuth.baggage.correlation-enabled

Those using MDC should know that for performance reasons, we no longer
set the following fields: `parentId` `spanExportable`.

We also do not set fields to "dirty" by default. Doing this by default
raised the overhead substantially, especially in reactive applications.

Those who want sleuth to override manual `MDC.put` operations as
described in #1416, or with to add back `parentId` `spanExportable` need
to define their own bean:

Ex. this is the former setup:

```java
@Bean CorrelationScopeDecorator oldConfig(List<String> myFieldNames) {
	CorrelationScopeDecorator.Builder builder = MDCScopeDecorator.newBuilder().clear()
			.add(SingleCorrelationField.create(BaggageFields.TRACE_ID))
			.add(SingleCorrelationField.create(BaggageFields.PARENT_ID))
			.add(SingleCorrelationField.create(BaggageFields.SPAN_ID))
			.add(SingleCorrelationField.newBuilder(BaggageFields.SAMPLED)
					.name("spanExportable").build());

        // Set all fields dirty, so that any changes made by MDC directly are reverted.
	for (String name : myFieldNames) {
		builder.add(SingleCorrelationField.newBuilder(BaggageField.create(name))
				.dirty().build());
	}
	return builder.build();
}

```
2020-04-06 23:06:10 +08:00
Adrian Cole
f01a65b035 Deprecates spring.sleuth.baggage-keys property (#1605)
The `spring.sleuth.baggage-keys` property assigned two headers for each
baggage. This causes unnecessary overhead and can be accomplished in another
way now:

```java
public class MyCode {
  static final BaggageField USER_ID = BaggageField.create("userId");

  @Autowired CurrentTraceContext currentTraceContext;

  @Nullable
  public String currentUserId() {
    return USER_ID.getValue(currentTraceContext.get());
  }

}

// In your @Configuration type, if you want to map multiple prefixes...
@Bean
BaggagePropagationConfig userIdBaggageConfig() {
  return SingleBaggageField.newBuilder(MyBaggage.USER_ID)
      .addKeyName("baggage-userId")
      .addKeyName("baggage_userId")
      .build();
}
```
2020-04-06 19:40:17 +08:00
Adrian Cole
3ac524c7e3 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.
2020-04-06 18:06:40 +08:00
Adrian Cole
89298ad600 Adds more robust introduction (#1603) 2020-04-06 16:39:16 +08:00
Adrian Cole
0b838a796d Removes duplication of Brave docs (#1601) 2020-04-06 13:14:06 +08:00
buildmaster
8d72c4a08d Bumping versions 2020-04-05 05:28:37 +00:00
Adrian Cole
5e1f7f9c0c Merge branch '2.2.x' 2020-04-04 14:39:36 +08:00
Marcin Grzejszczak
7b420a98e6 Updated Sleuth docs with attaching docs zip 2020-04-01 10:20:12 +02:00
Marcin Grzejszczak
9dbdbb6ca1 Updated docs 2020-04-01 08:54:23 +02:00
Marcin Grzejszczak
3e8d842de9 Merge branch '2.2.x' 2020-03-26 10:20:01 +01:00