Commit Graph

70 Commits

Author SHA1 Message Date
Marius Bogoevici
d0cf7381a4 Fix autoconfiguration ordering with Sleuth Stream (#557)
Fix #556

* Explicitly state that `StreamSleuthAutoConfiguration` should
  execute before `TraceAutoConfiguration`;
* Also ensure that `ChannelsEndpointAutoConfiguration` is configured
  after `StreamSleuthAutoConfiguration` to ensure that the bound
  channels are added to the `/channels` actuator endpoint
2017-04-07 07:10:41 +02:00
Marcin Grzejszczak
34dfb68a82 Yet another try with flickering tests 2017-02-28 10:28:00 +01:00
Marcin Grzejszczak
c8fd5aece5 Removed the flickering test 2017-02-28 09:08:04 +01:00
Marcin Grzejszczak
7b7ceefb0a Reverting the flickering fix
it has become even more flickering
2017-02-27 17:33:20 +01:00
Marcin Grzejszczak
6bb8b996e5 Trying to fix flickering 2017-02-27 16:41:52 +01:00
Marcin Grzejszczak
8d5b60996e Added missing aop dependency
fixes #534
2017-02-27 16:05:52 +01:00
Marcin Grzejszczak
b7659ede11 Updated the stream header setting in env post processor
without this kafka needs to add headers manually in properties
with this change is not necessary

fixes #529
2017-02-24 17:49:30 +01:00
Marcin Grzejszczak
a266d8bc6c Ensured that we guard against negative ports
fixes #518
2017-02-15 13:57:25 +01:00
Marcin Grzejszczak
9785bcae15 Due to possible performance problems when DiscoveryClient gives nonexistent DNS name as local address Local endpoint is created from server properties by default.
Local Ip determined from spring.commons InetUtils.
    To enable local endpoint resolution via service discovery, DiscoveryClient must be present and 'spring.zipkin.service.locator.discovery' should be set to true.
    FallbackHavingEndpointLocator was caching and recreating EndpointLocator in the same time - removed the caching part.

    Fixes gh-403
2017-01-11 12:46:19 +01:00
Marcin Grzejszczak
5b442e9526 Adding the spring.instance_id tag
without this tag it's impossible to discern from which server was the given span originated
    with this change we're adding a tag in which we're passing the instance id value. The value can be taken either from Cloud Foundry or from a concatanation of some local properties like instance_id / application name / application port etc.

    fixes #369
2017-01-03 14:44:56 +01:00
Marcin Grzejszczak
225a2d4cbf Added property for overriding the service name in Zipkin
without this only either service discovery service id / spring.application.name can be chosen as a service name for zipkin
    with this change you can pass spring.zipkin.service.name property to change override that both for HTTP and Stream collectors

    fixes #324
2017-01-02 10:39:18 +01:00
Dave Syer
a0adcecba0 Update to Spring Boot 1.5 2016-12-12 12:52:21 +00:00
Marcin Grzejszczak
e5dce64d71 Added a test for tracing the tracer 2016-11-06 10:06:17 +01:00
Marcin Grzejszczak
718a62ba5b Fixed the missing sampled flag for sleuth stream messages
without this change your message broker will explode due to number of message:sleuth messages
with this change it gets fixed
2016-11-06 09:28:58 +01:00
Marcin Grzejszczak
6642a369bc Not throwing an exception when queue size is exceeded
without this change when queue size of spans is exceeded for Stream span propagation, an exception is thrown that terminates business logic processing
with this change we're not propagating the exception - we're incrementing the dropped spans counter

fixes #421
2016-10-11 15:24:48 +02:00
Marcin Grzejszczak
9ebd9184ca Feign fixes
it turned out that some of the tests were leaky and didn't catch that ExceptionUtils were throwing an exception (race condition with Hystrix). That was due to the fact that When Hystrix with Feign were doing retries the RequestInterceptor wasn't called. That means that a new span wasn't created but a parent span was closed.

With this change the only place where the span creation and closing takes place is TraceFeignClient. I removed the Feign RequestInterceptor. Now whenever there is a retry - a new span is created and closed after getting a response. There are no exceptions, special cases etc.

In addition to that since Feign is fully immutable and SpanInjector is by design made to mutate objects I had to wrap the immutable Request in an AtomicReference in order to change the contents of the Request. I'm ashamed but didn't have a better idea. Since that is packaged scope nobody should every see that (outside the package of course)
2016-09-08 22:27:46 +02:00
Marius Bogoevici
bd8b64a5b9 Use StreamListener for coercing messages from JSON Span (#386)
* Use StreamListener for coercing messages from JSON `Span`

Rely on the `contentType` header of the transported message to
tell Spring Cloud Stream how to coerce the message to `Span`.
2016-09-08 15:56:29 +02:00
Marcin Grzejszczak
0066a243ec Fixed duplicate stream env post processor entries (#388)
when the stream env post processor is executed headers are added endlessly - there is no check for the presence of the tracing headers.

with this change a check is added so the tracing headers are added only once.

fixes #387
2016-08-30 13:09:05 +02:00
Marcin Grzejszczak
f043a347bc Bounding the queue for StreamSpanReporter
without this change the limit is MAX_INTEGER. With this change we set it to 1000

fixes #378
2016-08-18 12:26:45 +02:00
Marcin Grzejszczak
b26ae5da86 Updated the docs to include the new poller mechanism 2016-07-29 15:48:19 +02:00
Steve Oakey
32be48963c Added PollerMetadata for StreamSpanReporter (#343)
Added configurable PollerMetadata bean to be used with the Inbound
Channel Adapter in the StreamSpanReporter. Fixed delay and max messages
per poll are configurable via configuration properties. Implementors can
provide a bean of type PollerMetadata and name
StreamSpanReporter.POLLER to take full control of the poller.

Fixes: gh-338
2016-07-29 15:40:46 +02:00
Marcin Grzejszczak
00b1852efe Changed arraylist to linkedlist 2016-07-15 15:43:13 +02:00
Dave Syer
2a38aa1241 Fix property names for stream binder headers
Spring Cloud Stream changed the names of the headers config
that we need to propagate headers in kafka (and other binders
that do not support headers natively).

Fixes gh-284
2016-06-06 09:53:54 +01:00
Dave Syer
fe7271960d Compiler warnings 2016-05-04 11:32:03 +01:00
Marcin Grzejszczak
80f51f76fe Draining from queue instead of clearing it (#262)
now instead of first passing all the spans from the queue to the list and then clearing it we're now draining it contents. If in the meantime any spans will arrive they will be rained at next passing

fixes #259
2016-04-29 13:52:11 +02:00
Marcin Grzejszczak
c9cdb7e4c3 Added missing conditionals 2016-04-22 11:35:35 +02:00
Marcin Grzejszczak
184afe698d Added tests for exporting to Zipkin 2016-03-23 14:28:06 +01:00
Marcin Grzejszczak
a0048a806e Polish 2016-03-21 14:58:30 +01:00
Dave Syer
ef1c91b24d Use JSON for span transport with Stream by default
User can still override it and Stream should adjust itself, but
now we have JSON flowing between instrumented apps and the Zipkin
server.

Fixes gh-217
2016-03-17 20:04:31 +00:00
Dave Syer
35ba7bab95 Ensure that BPP dependencies are not created too early
The FeignBeanPostProcessor was causing other things to misbehave
by forcing early instantiation of all its dependencies. One of those
is a @MessageEndpoint when Sleuth Stream is in use, and the annotation
wasn't being processed because the bean was processed too early.
2016-03-17 11:29:46 +00:00
Marcin Grzejszczak
4d6fbd29bb Added missing conditionals
without it if you provide `spring.sleuth.enaled:false` the app would blow up
2016-03-16 16:31:42 +01:00
Marcin Grzejszczak
3bb7916fff Customizable headers
* Fixed the HttpServlet extractors
    (now the response can contain custom headers)
    * Changed header names to be Zipkin compatible
    * removed qualifiers and properties
    * updated the docs

fixes #19
2016-03-16 16:10:28 +01:00
Marcin Grzejszczak
146f7f652b Removed events and replaced them with method calls
fixes #156
2016-03-13 10:37:01 +01:00
Marcin Grzejszczak
e4bcd13b8c Added tests 2016-03-10 14:28:05 +01:00
Marcin Grzejszczak
24fa3514da Added missing tests 2016-03-09 17:49:27 +01:00
Marcin Grzejszczak
e5b1495613 Simplified Tracer API 2016-03-04 11:50:59 +01:00
Marcin Grzejszczak
6948d92d13 [#184] Stopped overriding tags via messaging
fixes #184
2016-02-25 13:44:33 +01:00
Marcin Grzejszczak
3000a4f37d [#69] Added javadocs
fixes #69
2016-02-25 11:23:23 +01:00
Marcin Grzejszczak
dc22434e27 More refactoring 2016-02-22 19:04:37 +01:00
Marcin Grzejszczak
7927f4914f Removed some package dependencies
* TraceKeys -> moved to root
    * TraceRunnable and TraceCallable moved to root
    * Websockets moved as a subpackage of messaging
    * created TraceMetricsAutoConfiguration in the metric package (thanks to this the TraeAutoConfiguration doesn't need any metric info)

    What’s left?
    * the remaining dependencies are related to everybody using events
    * there are a couple of usages of NeverSample
2016-02-22 17:09:23 +01:00
Marcin Grzejszczak
8333c31c99 [#158] Removing span name
fixes #158
2016-02-16 08:28:22 +01:00
Marcin Grzejszczak
ee8d7a54c7 Delomboking 2016-02-10 19:09:20 +01:00
Marcin Grzejszczak
1b0c8dfee5 [#146] Introduced SpanName
- Added aspect to provide better naming for @Async

fixes #146
2016-02-09 15:25:36 +01:00
Dave Syer
83d4986e48 Fix test with wrong asdsumption about null sampler 2016-02-04 13:24:09 +00:00
Dave Syer
9bfe364518 SamplerConfiguration -> SamplerProperties
Plus tidy up docs a bit
2016-02-02 16:15:35 +00:00
Dave Syer
70b18054e1 Add Span to Sampler method params
Also allows us to actually create a PercentageBasedSampler (I
don't think anyone tried it before) without resorting to
lazy beans and proxies.

Another freature added here is a default percentage sampler
if we know that spans need to be exported (zipkin or stream
is present).

Fixes gh-138
2016-02-01 17:00:00 +00:00
Dave Syer
39998a5def Ensure clients set X-Not-Sampled header for non-exportable Span
It also turns out that there's a bug in Spring MVC which makes an
empty header blow up in RequestHeaderMapMethodArgumentResolver
so we set the header to "true" instead of empty.

Fixes gh-136
2016-01-30 16:19:15 +00:00
Dave Syer
e2419d8cc0 Set default binding group name to "sleuth"
Can be changed by user with spring.sleuth.stream.group.

Fixes gh-134
2016-01-28 17:27:36 +00:00
Dave Syer
0c5c984e4a Use accumulated millisecs instead of computing span duration 2016-01-26 13:53:44 +00:00
Adrian Cole
ef7e70dde3 Prefers the word event when adding to a Span's timeline
Span.logs are really timestamped events. This clarifies the naming and
documentation around that.
2016-01-25 11:24:07 +01:00