Commit Graph

858 Commits

Author SHA1 Message Date
Marcin Grzejszczak
7caf522ecf Showing a workaround to make message serializable
this issue is there in core of Spring Framework  (https://jira.spring.io/browse/SPR-15262) but this tests shows how to apply a workaround to get ridd of that problem until we bump up version of SF.

related to https://github.com/spring-cloud/spring-cloud-sleuth/issues/520 and https://github.com/spring-cloud/spring-cloud-sleuth/issues/523
SO - http://stackoverflow.com/questions/42277170/messagedeliveryexception-thrown-when-using-amqp-backed-channel-with-brixton-sr7

fixes #520
2017-02-23 16:28:47 +01:00
Marcin Grzejszczak
4795b20ec7 Making actuator and web optional dependencies
without this change we're explicitly requiring our users to take both web and actuator into their classpath. That makes little sense since not every app is a web app.
with this change we're making those deps optional

fixes #524
2017-02-23 10:56:58 +01:00
Marcin Grzejszczak
08630c580c Fixed the missing surefire plugin 2017-02-21 18:02:03 +01:00
Marcin Grzejszczak
6ac48cfc01 Fixing a broken test 2017-02-20 15:47:31 +01:00
Marcin Grzejszczak
0ce6b256ba Added CLI 1.3.0.BS for e2e 2017-02-19 23:07:20 +01:00
Marcin Grzejszczak
49b96d43b6 Added CLI 1.3.0.BS for e2e 2017-02-19 22:52:44 +01:00
Marcin Grzejszczak
a266d8bc6c Ensured that we guard against negative ports
fixes #518
2017-02-15 13:57:25 +01:00
Marcin Grzejszczak
ba128a24de Updated libs
fixes #517
2017-02-15 10:36:20 +01:00
Marcin Grzejszczak
726be4f944 Caches the result of getting error controller bean
related to #512
2017-02-13 11:25:05 +01:00
Marcin Grzejszczak
05f812abe0 Lack of ErrorController will not result in blowing up the application
without this change when someone has a missing ErrorController bean then TraceHandlerInterceptor blows up
with this change that problem gets fixed

fixes #512
2017-02-13 10:47:37 +01:00
Marcin Grzejszczak
4a818eee73 Added back the baggage docs 2017-02-08 13:29:01 +01:00
Marcin Grzejszczak
9d21d1b07b Updated the docs with logging pattern 2017-02-08 10:41:10 +01:00
Marcin Grzejszczak
ce226ba334 Removing colour from the logging pattern\n\nwithout this change due to the presence of colours in the logging pattern, the logs could be corrupt in some cases\nwith this change we're removing the colour\n\nfixes #510 2017-02-07 17:35:07 +01:00
Marcin Grzejszczak
db75bb2cc4 Fixing broken benchamrks - again 2017-02-07 17:14:04 +01:00
Marcin Grzejszczak
1e7ea022db Fixing broken benchamrks 2017-02-07 17:04:08 +01:00
Arthur Gavlyukovskiy
634fa90a0d Display overriden service name in logs (addition to #487) (#507)
Use `spring.zipkin.service.name` if present.
2017-02-02 09:13:37 +01:00
Marcin Grzejszczak
ea30fefdf9 Removed duplicated dependency
fixes #504
2017-02-01 11:20:04 +01:00
Marcin Grzejszczak
b996de50ea Fixing the moment when SS is set
without this change there's a problem with the time when the SS is set on a span. Currently it's done in TraceFilter's finally block. The problem is that this code is executed after the response has been sent back to the client. Thus CR sometimes was set faster than SS (it doesn't make any sense from the logical point of view).

with this change we're introducing wrappers over the HttpServletResponse where we annotate the span with SS just after the response gets sent to the recipient.

fixes #492 #431
2017-02-01 10:49:47 +01:00
Marcin Grzejszczak
6d445f56f4 Going back to snapshots 2017-01-30 10:37:40 +01:00
Marcin Grzejszczak
adfaa036a2 Bumping versions before release 2017-01-30 10:31:39 +01:00
Marcin Grzejszczak
ba4e4f32c1 Giving an option to reuse a custom feign client
without this change you couldn't register your own client (for example to set your ssl config) for Sleuth to reuse it
with this change we're reusing a registered feign client bean or creating a default one if necessary

fixes #502
2017-01-26 18:52:59 +01:00
Brian Devins
1c7d861ffc Add a new log method to span that allows for setting the time (#501)
* Add a new log method that allows for setting the time
* Clarify with time unit
* Simple test and spelling correction
* Consolidate "logic" and add a test for the other log method
2017-01-25 17:25:44 +01:00
Adrian Cole
32d8ea8fc7 Updates to latest zipkin 1.19 (#495)
Most changes are not very interesting to sleuth, though the server is
quite a lot better with UI fixes galore. For sleuth mainly, small api
unaffecting glitch fixes around the Span.Builder.
2017-01-19 20:20:27 +08:00
Marcin Grzejszczak
c347f724cd Add an option to use the X-B3-Flags header to override any sampling decision
without this change it's pretty much impossible to enforce sampling for certain traces
    with this change setting the X-B3-Flags to 1 for HTTP messages / spanFlags to 1 for messaging will override any sampling decisions

    fixes #496
2017-01-18 13:12:13 +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
Ryan Baxter
e4aa135253 Merge pull request #491 from ryanjbaxter/master
Merging PR #446 into master
2017-01-10 15:11:28 -05:00
Ryan Baxter
583893a29d Merging PR #446 into master. 2017-01-10 14:55:32 -05: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
6ddd009498 Added test for non web apps, fixed the autoconfig in that case
without this change the non web apps can't start
    with this change the missing bean gets registered

    also in terms of non boot apps if there is no port or address set we're providing some default values. In terms of the service name one can always use the override via the spring.zipkin.service.name property

    fixes #32
2017-01-02 15:42:28 +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
Arthur Gavlyukovskiy
24f6827a4a Created @ConfigurationProperties classes and updated additional metadata (#485)
* Created @ConfigurationProperties classes and updated additional metadata
2016-12-30 12:42:38 +01:00
Marcin Grzejszczak
7c7660a84f Added checks to close / detach only if tracing
without this change during asynchronous communication some components are trying to detach or close spans that were aready detached. This leads to exceptions utils warnings and spans were not closed.
    with this change we're adding additional checks to ensure that we're tracing

    fixes #447
2016-12-30 11:49:05 +01:00
Marcin Grzejszczak
7e393cdf38 Explained TraceAsyncRestTemplate bean creation
fixes #484
2016-12-29 13:38:40 +01:00
Marcin Grzejszczak
5df50bf4ea Increased timeout for Zipkin Server start 2016-12-27 10:52:27 +01:00
Toshiaki Maki
a28cc4600f Add tip in case of using spring-cloud-sleuth-stream and spring-cloud-netflix-hystrix-stream (#482)
* Add tip in case of

spring-cloud-sleuth-stream and spring-cloud-netflix-hystrix-stream
2016-12-27 08:51:18 +01:00
Marcin Grzejszczak
03c4300215 Adding parent id to MDC
without this change we couldn't reference parent id in the logs
    with this change we add the parent id to MDC context

    fixes #480
2016-12-20 18:14:38 +01:00
Marcin Grzejszczak
7ad0803336 Added a check for tracing in Trace Filter 2016-12-20 15:57:07 +01:00
Marcin Grzejszczak
d2bf1ea776 Detaching async traces only if tracing is still in progress 2016-12-19 16:52:43 +01:00
Marcin Grzejszczak
a9139b57db Updated readme with new span approach 2016-12-19 14:58:47 +01:00
Marcin Grzejszczak
d35cf2e74f Adding SA only if peer tag is present
without this change Zipkin doesn't properly visualize the span on the server side.
with this change we're setting SA only if peer tag is set.

fixes #481
2016-12-19 13:32:03 +01:00
Marcin Grzejszczak
4f9bf6d6e4 Added consistency between metric and metrics
without this change we have 2 different properties. One is `spring.sleuth.metric` and the other is `spring.sleuth.metrics`.
with this change we're introducing conditionality on `spring.sleuth.metric.enabled`

fixes #477
2016-12-19 11:58:36 +01:00
Marcin Grzejszczak
b61be04866 Fixing race conditions in tests 2016-12-19 10:20:18 +01:00
Marcin Grzejszczak
964afe10f7 Premature async rest template (#479)
without this change the async rest template provides wrong value of the span duration
with this change the span is closed via a callback

fixes #475
2016-12-16 15:18:29 +01:00
Marcin Grzejszczak
73fb8a8c4c Made tests even less brittle 2016-12-16 15:10:28 +01:00
Marcin Grzejszczak
f047b39fd8 Made tests less brittle - fixed the stupid change 2016-12-16 14:14:14 +01:00
Marcin Grzejszczak
765e41d6c7 Made tests less brittle 2016-12-16 13:51:50 +01:00
Marcin Grzejszczak
1b832b6029 Spans are continued in Handler Interceptors (#474)
without this change an explicit new span is created on the server side. Its name is equal to the method name of the controller. It introduces some nice advantages in terms of readability of trace.

with this change we're continuing a previous span on the server side. We're attaching the tags and logs to that span with information about controller class and controller name. Also events related to start and finish of the controller are there.

fixes #471 #469 #427
2016-12-16 13:51:37 +01:00
Dave Syer
a0adcecba0 Update to Spring Boot 1.5 2016-12-12 12:52:21 +00:00
Marcin Grzejszczak
7855560fa9 Fixed disabling of Sleuth
without this change it's impossible to disable Sleuth when you have registered a Random bean
with this change the conditions are fixed

fixes #462
2016-12-08 15:25:55 +01:00
Marcin Grzejszczak
8c8c3e919b Continuing Spans (#461)
With this change we change the approach to continue spans (if they already exist) instead of starting new ones. The RPC spans would still be generated but Hystrix, Async, Callables / Runnables will reuse an existing span if there is one.

the scenarios are as follows:

Assuming that we have a trace X with span Y
* if you used tracer.wrap(Callable) or trace.wrap(Runnable) then:
  * previously you'd get a span Z created when the Callable / Runnable is executed
  * with this change you'll continue the span Y
* if you used a HystrixCommand then
  * previously you'd get a span Z together with added tags when the command got executed
  * with this change you'll continue the span Y and the tags will be added to span Y
* if you used a ExecutorService then
  * previously you'd get a span Z together with added tags when a method from ExecutorService got executed
  * with this change you'll continue the span Y and the tags will be added to span Y

Assuming that there was no span then everything will work as previously.

In order to create a new span you just have to create it manually. Example of creating a new span for an `@Async` annotated method.

```
// obviously you should inject via constructor ;)
@Autowired Tracer tracer;

@Async
public Future<String> foo() {
    Span span = tracer.createSpan("newSpan");
    try {
       // do your stuff
    } finally {
       this.tracer.close(span);
    }
}
```

fixes #174
2016-12-07 11:18:13 +01:00