Commit Graph

1544 Commits

Author SHA1 Message Date
zhanghaoxin-at-826767166263
e92a735faa add unit test for saved template 2020-05-09 14:57:06 +08:00
Tim te Beek
b3cfa42448 Get KafkaStreamsTracing via BeanFactory to prevent eager initialization (#1623) 2020-05-09 13:22:25 +08:00
张哈希
343d84346f replace method for deprecation and keep reference of requestTemplate 2020-05-09 13:22:15 +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
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
47c2523ede Avoid double-load-balancing. Fixes gh-1610. 2020-04-07 13:44:23 +02:00
Adrian Cole
fa6eb20914 latest brave 2020-04-06 16:54:15 +08: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
a497befa56 pulls change back from master 2020-04-04 09:49:36 +08:00
Adrian Cole
c20f6c6a11 Moves Slf4jScopeDecorator to use CorrelationField internally (#1597) 2020-04-03 19:57:37 +08:00
Adrian Cole
50ebf7b5c7 Rewrites Slf4jScopeDecorator internally to re-use Brave's (#1595) 2020-04-03 08:50:08 +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
Adrian Cole
1e1e1f04bf Finalizes reactor-netty HttpClient implementations (#1586) 2020-03-26 17:10:01 +08:00
Marcin Grzejszczak
64d2355cc4 Not tagging OK http responses with error tag; fixes gh-1590 2020-03-26 09:46:42 +01:00
Adrian Cole
e5308d7111 Tracks requested but without signal interference (#1581) 2020-03-06 11:45:32 +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
Adrian Cole
7d053beed9 Attempts to align feign code with master (#1577)
This tries to pick in the relevant changes made in 3813cf9dd4

Notably, there's one glitch, `TraceFeignAspect` still passes bean, not
wrappedBean. The latter trips out `ManuallyCreatedLoadBalancerFeignClientTests`
as the nonexistenturl raises a hard error in Ribbon. I *think* this is a bug and
tests need to just adjust for that, but need a second opinion. Also, I'm not
entirely sure the intent of using the broken url then asserting against a
success result..
2020-03-02 18:30:26 +08: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
2ea203076b Fixes WebClient which started a client span prior to a subscription (#1576)
In looking at underlying HttpClient mechanics, I noticed the reactor
call doesn't happen until subscribe. Before this change, we started the
client span at the ExchangeFilterFunction, not at subscribe time.
2020-03-02 07:58:08 +08:00
Adrian Cole
71b7eb0fa6 feign cleanup 2020-03-02 07:57:21 +08:00
Adrian Cole
0446918fcf Ensures spring context is closed in brave tests (#1572) 2020-02-26 15:11:18 +08:00
Adrian Cole
547a124d41 Adds Brave tests for reactor-netty (#1554) 2020-02-24 15:46:35 +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
20ca616b69 Fixes broken propagation in reactor HttpClient (#1560) 2020-02-13 16:15:31 -08:00
Adrian Cole
0ecb23ee88 Fixes parse glitches and adds remote endpoint to reactor HttpClient (#1559) 2020-02-13 15:28:31 -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
707abda92a fixes curse of the feign mocks 2020-02-13 14:12:06 -08:00
Adrian Cole
f53101f5b8 Fixes propagation break and error handling in reactor-netty HttpClient (#1552) 2020-02-08 08:56:51 +08:00
Adrian Cole
2f0e3ed2c7 formatting 2020-02-06 15:36:50 +08:00
Adrian Cole
3c0932bb32 Fixes null bugs on WebClient canceled request (#1548) 2020-02-06 15:02:12 +08:00
Adrian Cole
c2cd689ec7 Reduces the amount of times getBean is invoked from reactor-netty (#1551)
This consolidates access to the `HttpTracing` bean so that the overhead
of netty `HttpClient` is reduced. It also pulls the reactor-netty test
into its own file.
2020-02-06 13:36:57 +08:00
Marcin Grzejszczak
415c809fd0 Added better remote name resolution for messaging; fixes gh-1481 2020-02-05 13:36:15 +01:00
Marcin Grzejszczak
ac43895b75 Ignores stream spans for channels with name starting with channel* ; fixes gh-1549 2020-02-05 13:21:37 +01: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
36aed2b888 Extracts LazyBean and backports reactor code to use it (#1542)
There are numerous places where code defensively guards access to
BeanFactory methods. This centralizes the code, first using in reactor
as that's the more performance sensitive.

This also weaves in feedback from #1541 given by @simonbasle and @robotmrv
2020-02-04 09:07:06 +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
4acbaf38f3 Refactors some of the reactor code (#1541) 2020-01-31 15:48:19 +08:00
Marcin Grzejszczak
c80e145065 Checks if context isn't closed; fixes gh-1526 2020-01-31 08:19:05 +01:00
Marcin Grzejszczak
c426fa5c63 Merge branch '2.1.x' into 2.2.x 2020-01-30 13:50:25 +01:00
Marcin Grzejszczak
b830137ac5 Fixing wrong ScheduledExecutorService wrapping; fixes gh-1536 2020-01-30 12:58:37 +01:00
Adrian Cole
cba886720d latest brave 2020-01-29 15:07:06 +08:00
Adrian Cole
8431588db7 Removes deprecations from server code (#1534) 2020-01-24 08:42:05 +08:00
Adrian Cole
e5227ba090 Moves client instrumentation off deprecated Brave code (#1532) 2020-01-22 14:23:47 +01: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