* 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)
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
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
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.
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
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
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
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
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
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.
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
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