Commit Graph

93 Commits

Author SHA1 Message Date
Marcin Grzejszczak
aea67cb0bb Improved checks on final methods and cglib proxy creation; fixes gh-1569 2020-08-06 17:13:45 +02:00
Marcin Grzejszczak
f31df6b3e2 Resolves the remote ip when behind proxy; fixes gh-1683 2020-08-05 18:28:19 +02:00
buildmaster
bb8d203f4c Bumping versions to 2.2.5.BUILD-SNAPSHOT after release 2020-07-31 21:27:20 +00:00
buildmaster
8fe9812944 Going back to snapshots 2020-07-31 21:27:20 +00:00
buildmaster
db7427984e Update SNAPSHOT to 2.2.4.RELEASE 2020-07-31 21:25:19 +00:00
spencergibb
cd72c6954f Comments out failing bit of test.
See gh-1702
2020-07-31 15:45:31 -04:00
Ivo Smid
18c27d9a43 Optional/Null parameter used within @SpanTag 2020-06-30 14:26:54 +02:00
Roberto Tassi
791f729f49 Adds tracing on every factory methods in KafkaListenerContainerFactory (#1665) 2020-06-29 15:13:52 +02: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
Adrian Cole
a6573bc2a5 Uses B3 single for non-remote spans (2.2.x) (#1655)
This makes sure there cannot be JMS problems related to use of
hyphenated headers unless someone overrides the `Propagation.Factory`.

To avoid this, we set non-remote spans to B3 single format as done on
the 3.x branch here:
https://github.com/spring-cloud/spring-cloud-sleuth/pull/1607/files#diff-db43b7e91bd69d063333c20b947c902bR83-R84
2020-05-26 14:42:27 +08:00
Marcin Grzejszczak
473549f000 Removed / ignored flakey tests; fixes gh-1635; fixes gh-1652 2020-05-22 13:51:14 +02:00
Adrian Cole
d02493ca40 Reverts JmsTracingConfigurationTest test configuration
JmsTracingConfigurationTest flakes in Jenkins for some reason that appears
like either the test rule not being honored or tests run concurrently.
2020-05-20 08:30:01 +08:00
Adrian Cole
453be43b5a bump 2020-05-18 21:13:23 +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
048227806a undeprecate the entry-level zipkin things as they are documented 2020-05-17 20:48:03 +08:00
Adrian Cole
60bf5ce497 Rewrites async test to be less circuitous and more valid (#1641)
I had flakes on TraceAsyncIntegrationTests and it was hard to tell why
as there were so many problems with it. It used a normal list in async
setting, it unnecessarily created extra spans, it added a hook inside
the async method which if passed only told you it was in the middle of
an op, not the end of it. The method danced around making failure in
console almost impossible to decipher.

This took me a few hours to make just a normal test. Hopefully, the
others will keep passing as I can't afford time to redo all of them.
2020-05-17 14:21:30 +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
Adrian Cole
f9821495e1 Deprecates ExceptionLoggingFilter and disables it by default (#1633)
`ExceptionLoggingFilter` logs "Uncaught exception thrown" to error level
when there is a synchronous exception not otherwise swallowed. This is a
cure worse than the disease. This disables it by default and the 3.x
should end the years of problems it caused.
2020-05-15 20:27:13 +08:00
Adrian Cole
16fb8e3ac6 Moves responsibility to import SamplerAutoConfiguration to core
Before, spring-cloud-sleuth-zipkin had to import `SamplerAutoConfiguration`
directly to unwind a sampler ordering problem caused by `TraceAutoConfiguration`
defining the default `Sampler` bean.

This fixes that by moving the default `Sampler` to where it belongs
(`SamplerAutoConfiguration`) and having `TraceAutoConfiguration` import
the sampling configuration directly as opposed to relying on auto-configuration
ordering. Finally it removes the mistake of setting `SamplerAutoConfiguration`
as auto-configuration in the first place.

The name `SamplerAutoConfiguration` was left alone because changing it would
interfere with 3rd party code that formerly imported it to correct this issue
in their non-zipkin setups.

Fixes #1618
2020-04-22 19:04:19 +08:00
Olga Maciaszek-Sharma
20e29f2d80 Adjust method name to previous changes. 2020-04-07 13:46:37 +02:00
Olga Maciaszek-Sharma
15ee807b85 Refactor tests and make them not rely on LoadBalancerFeignClient side effects. 2020-04-07 13:43:37 +02:00
Adrian Cole
3d677d0090 Fixes bugs in skip pattern code and Feign tests (#1598)
Before, the client sampler would only skip the path named ""! This was
the path used in one of the failing Feign tests, which made
troubleshooting like a murder mystery.

The "" is a regression in spring-cloud-openfeign noted below:
https://github.com/spring-cloud/spring-cloud-openfeign/pull/245/files#r40342437
2020-04-04 13:37:26 +08:00
Adrian Cole
60820379f1 Updates to latest brave and removes all static thread local use (#1594) 2020-04-03 08:01:22 +08:00
Marcin Grzejszczak
35472366b2 Ignored flakey tests 2020-04-02 12:03:18 +02:00
Adrian Cole
d0a3e6952b Tries higher read timeout for jenkins 2020-03-26 17:41:00 +08:00
Adrian Cole
1e1e1f04bf Finalizes reactor-netty HttpClient implementations (#1586) 2020-03-26 17:10:01 +08:00
Adrian Cole
dd13f09844 Adds first unit test for HttpClientBeanPostProcessor (#1580) 2020-03-06 11:07:00 +08:00
Adrian Cole
656c4720cb Switches to a less flakey span reporter (#1579) 2020-03-06 10:43:54 +08:00
Adrian Cole
42add19daa Adds base integration test for reactor clients and adds cancelation tests (#1578) 2020-03-05 12:30:01 +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
2024e28937 Added example with Stream Bridge 2020-03-03 16:22:18 +01:00
Adrian Cole
27fe606c83 polish 2020-03-02 16:24:59 +08:00
Adrian Cole
eec55b9a6c Adds wiring for HttpRequestParser and HttpResponseParser (#1575) 2020-03-02 09:12:47 +08:00
Adrian Cole
7262790717 Performs minimal work to update to Brave 5.10 (#1573)
A later PR will handle new features/deprecation
2020-02-26 16:43:14 +08:00
Adrian Cole
0446918fcf Ensures spring context is closed in brave tests (#1572) 2020-02-26 15:11:18 +08:00
Adrian Cole
51c9158837 Fixes WebClient propagation errors and adds Brave Tests (#1562)
In many places, the trace context of callbacks was accidentally set to
the client span, not the invocation context. I noticed a hack trying to
work around this. This code fixes all the problems around context. It
also removes some sporadic logging, which was only applied to a few
hooks.

Finally, this adds Brave tests which would have caught the problems
earlier. Notably, there is still more work to do as this will not help
with duplicate instrumentation, which is normal when reactor-netty is
the WebClient's HTTP connector.
2020-02-24 14:34:25 +08:00
Adrian Cole
47416a8eef Reduces scope copies when desired context is already current (#1558) 2020-02-13 14:56:47 -08:00
Adrian Cole
905ef2cc6f yolo attempt to deflake build 2020-02-07 16:14:39 +08:00
Adrian Cole
4de484504e refactoring flakey test 2020-02-06 15:36:57 +08:00
Adrian Cole
af04d9d431 Corrects HookRegisteringBeanDefinitionRegistryPostProcessor.setupHooks (#1546)
Probably due to code drift, `HookRegisteringBeanDefinitionRegistryPostProcessor.setupHooks`
was used as an object method, which led to a confusing no-op chain in
tests.

This ensures it is used consistently as a static method, and also
corrects a bean accidentally marked static for testing.
2020-02-04 10:16:55 +08:00
Adrian Cole
241f536aef Uses ConfigurableApplicationContext consistently in Reactor (#1545)
Before, we used ConfigurableApplicationContext or BeanFactory eventhough
we already had a reference to ConfigurableApplicationContext. This uses
the latter consistently, avoiding a state condition that caused more
code.

This also corrects some misnamed tests and adjusts them to verify only
what they are responsible for.
2020-02-03 19:26:38 +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
Olga Maciaszek-Sharma
d7b7e81235 Gh 1528 instrument feign sc loadbalancer client (#1531)
* Add optional SC LoadBalancer dependency. Create TraceFeignBlockingLoadBalancerClient.

* Instrument Spring Cloud LoadBalancer in TraceFeignObjectWrapper.

* Do not use class in field in order to avoid NoClassDefFound.

fixes #1528
2020-01-21 19:57:23 +01:00
Olga Maciaszek-Sharma
31d4574a1c Fix test naming. 2020-01-20 16:05:31 +01:00
Adrian Cole
58a956b29a Addresses Spring Boot 2.3 drift (#1527) 2020-01-20 16:42:17 +08:00
Adrian Cole
d08e106100 Reduces overhead when using reactor by avoiding redundant context syncs (#1525)
This switches to pass around and use `TraceContext` instead of `Span` in
Reactor's context to take advantage of `maybeScope` which is far cheaper
than `withSpanInScope` when the span is already current. This also kills
some extra scope checks and any other accidental calls noticed.

The performance improvement here, I can't quantify as haven't done any
JMH on it.
2020-01-17 23:50:32 +01:00