Commit Graph

351 Commits

Author SHA1 Message Date
Adrian Cole
a7aca7562a Updates to Zipkin 1.3 and rounds up Span duration to one when < 1μ (#326)
Duration of 0 is confusing to plot and can be misinterpreted as null.

See https://github.com/openzipkin/zipkin/issues/1174
See https://github.com/openzipkin/zipkin/releases/tag/1.3.0
2016-07-10 12:08:36 +08:00
Marcin Grzejszczak
bfce279d52 Re-added missing server side span (#322)
* Re-added missing server side span

with this change

- HandlerInterceptor is responsible for wrapping requests in spans
- added Sring Data REST instrumentation
- added Zuul instrumentation
- it will not wrap error controller related requests with spans
- tests have been changed to ensure that ALWAYS there is at least one span on the server side (that way it will show up in Zipkin)
- "fallback" mechanism has been added that if a HandlerInterceptor hasn't been used then we are forcing creation of a Span at the server side

fixes #321
(cherry picked from commit 4f1ef52e6c)
2016-07-07 11:03:33 +02:00
Marcin Grzejszczak
48d46b07bb Added RibbonCommand instrumentation (#318)
with this change RibbonRequestCustomizers are created for
- Netflix HttpClient
- OkHttp client
- Apache HttpClient

those customizers know how to inject span into the given context. Also a wrapper over a RibbonCommandFactory bean gets created that injects http trace keys to the given span

fixes #313
2016-06-30 13:02:31 +02:00
Marcin Grzejszczak
61e70deff5 Fixed the hacks for Feign 2016-06-30 11:48:54 +02:00
Marcin Grzejszczak
6bc4a9862b Fixed not clearing spans on messaging exception
with this change we're closing spans on afterSendCompletion and not afterPost thus even if an exception is thrown we will close the span

    fixes #319
2016-06-30 11:21:27 +02:00
Marcin Grzejszczak
6b5fa63553 Exposes getAccumulatedMicros for more precise Span duration (#317)
Formerly, `Span.getAccumulatedMillis()` worked, but could returns
    imprecise measurements, particularly local spans. This changes the
    internals of Span to keep track of a start tick. Using this, it can
    return a more precise `Span.getAccumulatedMicros()`.

    To ensure this precision isn't lost in serialization, this adds a
    json field `durationMicros`, which is only set when the span is stopped.
    This is set instead of start tick because `System.nanoTime()` is JVM
    specific and so cannot be used across the network. `durationMicros` uses
    null instead of zero comparisons because nano time can be negative.

    Fixes #312

    Fixed integration tests to use ZipkinRule
    Introduce assertj assertions (#315)

    * Introduce assertJ assertions in some tests
    * Fix code formatting to be inline with Spring rules
2016-06-29 10:44:00 +02:00
Spencer Gibb
43a8bcfe2e Pass empty collections rather than null. 2016-06-27 14:46:27 -06:00
Marcin Grzejszczak
32450358bf Introduce assertj assertions (#315)
* Introduce assertJ assertions in some tests
    * Fix code formatting to be inline with Spring rules
2016-06-25 10:29:28 +02:00
Marcin Grzejszczak
e4e36d42b7 Fixed issues with aspects 2016-06-24 02:04:40 +02:00
Marcin Grzejszczak
9242ccec06 Updated aspects with SpanNameUtil 2016-06-24 02:01:39 +02:00
Marcin Grzejszczak
7a4dcf6f05 Fixed the aspect for controllers 2016-06-24 01:50:37 +02:00
Marcin Grzejszczak
7ea2859583 Merge branch '1.0.x' 2016-06-23 14:45:43 +02:00
Marcin Grzejszczak
05e221ef54 HTTP filter child span renamed
with this change the child span of the HTTP filter span gets changed into a span coming from the Controller aspect. The name of the span becomes the name of the method.
2016-06-23 13:24:16 +02:00
Marcin Grzejszczak
187c58aceb Fixed the issue with Zuul and error code 2016-06-23 11:26:41 +02:00
Marcin Grzejszczak
31a0bd885f Added connection factory to rest template for tests 2016-06-23 11:26:41 +02:00
Marcin Grzejszczak
0d6f27f43a Throwing exception when tracing is malformed (#308)
with this change we will throw an IllegalArgumentException when the malformed tracing data are sent. In TraceFilter we're catching it and sending back 400 response. In case of messaging the exception gets propagated

fixed #306

* Changes following review

* Changes following review
2016-06-22 16:39:33 +02:00
Marcin Grzejszczak
be735659b6 Wrong span / trace ids dont blow up the app
with this change we're trying to retrieve the value of span / trace id from a header but we don't propagate the exception if that value is invalid. Instead we generate a new random value. It's better not to break the application and break the trace (if by any chance it's been corrupt).

Fixed #306
2016-06-22 16:39:23 +02:00
Marcin Grzejszczak
b7b8b30c21 Fixing tests for Jenkins 2016-06-22 16:39:10 +02:00
Marcin Grzejszczak
a9c1d89668 Made evaluation of Tracer bean more lazy
with this change Feign components resolve tracer and other beans from beanfactory when necessary

fixes #307
2016-06-22 16:38:53 +02:00
Marcin Grzejszczak
117a5e8347 Throwing exception when tracing is malformed (#308)
with this change we will throw an IllegalArgumentException when the malformed tracing data are sent. In TraceFilter we're catching it and sending back 400 response. In case of messaging the exception gets propagated

fixed #306

* Changes following review

* Changes following review
2016-06-22 14:09:12 +02:00
Marcin Grzejszczak
6bea07af1e Wrong span / trace ids dont blow up the app
with this change we're trying to retrieve the value of span / trace id from a header but we don't propagate the exception if that value is invalid. Instead we generate a new random value. It's better not to break the application and break the trace (if by any chance it's been corrupt).

Fixed #306
2016-06-22 01:14:53 +02:00
Marcin Grzejszczak
d35a6eb017 Fixing tests for Jenkins 2016-06-22 00:24:09 +02:00
Marcin Grzejszczak
72714118d5 Made evaluation of Tracer bean more lazy
with this change Feign components resolve tracer and other beans from beanfactory when necessary

fixes #307
2016-06-21 23:54:53 +02:00
Marcin Grzejszczak
be6165e69c Fixed the issue with Zuul and error code 2016-06-17 10:23:47 +02:00
Marcin Grzejszczak
ea076ce944 Added verification for lack of response status code
With this change when there is no http response status code an exception is not thrown and the tags are not set for http.status_code

    fixes #304
2016-06-15 13:09:24 +02:00
Marcin Grzejszczak
78dc17fc45 Added verification for lack of response status code
With this change when there is no http response status code an exception is not thrown and the tags are not set for http.status_code

fixes #304
2016-06-15 13:07:42 +02:00
Marcin Grzejszczak
d6772db504 Added connection factory to rest template for tests 2016-06-11 09:28:23 +02:00
Dave Syer
fea2397501 Update to 1.0.2 snapshots 2016-06-10 17:10:35 +01:00
Marcin Grzejszczak
6456709020 Update to SNAPSHOT 2016-06-10 15:56:21 +02:00
Marcin Grzejszczak
8f726cb514 Update SNAPSHOT to 1.0.1.RELEASE 2016-06-10 15:38:37 +02:00
Marcin Grzejszczak
0a188cd8df Extracted a method for readability purposes 2016-06-10 15:09:40 +02:00
Marcin Grzejszczak
7cd49319dc Bumped up logging level to DEBUG 2016-06-10 09:31:21 +02:00
Marcin Grzejszczak
65796e9aa2 Added client side tags for zuul (#302)
Now when a request is sent via Zuul, the HTTP client side tags will be added to the request
2016-06-10 08:53:01 +02:00
Marcin Grzejszczak
fbfed722c7 Altered tests 2016-06-09 21:42:57 +02:00
Marcin Grzejszczak
0f60e5bf67 Fixed the issues with Zuul exception handling (#300)
TraceFilter no longer is a OncePerRequestFilter
TraceFilter processes the request that is executed upon ERROR dispatch (the logs will be present there)
Altered the logic in TraceFilter that an already processed request will not be detached (which resulted in an exception)
Added some debugging to instrumentation
Added assertion over a list of spans
Bumped up SC-Netflix to 1.1.2.BUILD-SNAPSHOT
Added Zuul integration tests
Added Http keys injection to Zuul client call
2016-06-09 18:26:46 +02:00
Marcin Grzejszczak
e9cfe6d2ab Lowered logging level for RxJava hook - in debug mode it's present every second 2016-06-07 15:20:12 +02:00
Marcin Grzejszczak
5f716611ae Fixed the missing spanid in incoming http request
until now if traceid was set and span id wasn't we were generating a new span id. That approach was wrong since
1) there shouldn't be such a situation in the first place (you have to have neither or both headers set)
2) if there is one we should assume that the span is the root one

so ATM in case of missing span id we are placing the trace id value there.
2016-06-07 15:07:10 +02:00
Marcin Grzejszczak
23d9b23cec Fixed a typo 2016-06-07 14:11:56 +02:00
Marcin Grzejszczak
8856854002 Fixed duplicated logs in tracefilter 2016-06-07 10:17:32 +02:00
Marcin Grzejszczak
a613e8a0e4 Changed aspect into filter with custom dispatch (#297) 2016-06-06 12:25:37 +02:00
Marcin Grzejszczak
7e215aac82 Added aspect that closes spans for wrong http responses (#296)
with this change trace filter is not closing all spans. It's closing only spans when the response is successful. If the response status is 4xx,5xx then an exception controller should start processing the response. At the end of the day an aspect will close the span once the controller has finished processing.

fixes #278
2016-06-06 10:20:18 +02:00
Dave Syer
2b058be77e Update tp mvn 3.3.9 2016-06-04 09:14:48 +01:00
Marcin Grzejszczak
a194c4a17a Added list of threads to ignore for rx (#294)
fixes #274

* Updates following code review
2016-06-02 19:20:12 +02:00
Marcin Grzejszczak
a3dc021ec4 Added a test for deferred result returning controller 2016-05-31 13:41:49 +02:00
Marcin Grzejszczak
d30efca703 Updated HTTP client side span with HTTP tags
After this change when sending an HTTP request, the client side span will have all the necessary HTTP related tags.

Fixes #290
2016-05-31 09:31:55 +02:00
Marcin Grzejszczak
a7480880ea Fixed sonar suggestion 2016-05-28 23:43:57 +02:00
Marcin Grzejszczak
4f9a953285 Decreased visibility of TraceFeignContext 2016-05-27 09:01:39 +02:00
Marcin Grzejszczak
0a0d36053d Cloning the Retryer
@dpalita's suggested that since Default Retryer implemenation is not thread-safe we have to clone the delegate. And obviously he's right!
2016-05-27 08:52:47 +02:00
Marcin Grzejszczak
00d06a17c0 Fixed wrong cloning of TraceFeignRetryer
ATM we're cloning the retryer with the default retryer as a delegate. We should be honouring the retryer that the user has provided.

Fixes #291
2016-05-27 08:19:18 +02:00
Marcin Grzejszczak
358d0b16b5 Issues #286 custom feign config (#289)
After this change a custom FeignContext is created that before returning instance  or instances of beans will wrap, if necessary, that bean into a tracing representation. That way all the custom Feign configurations will have wrapped beans and tracing will get propagated.

Fixes #286
2016-05-25 18:12:06 +02:00