Commit Graph

177 Commits

Author SHA1 Message Date
Dave Syer
203d9cc4f2 Update to 1.1.0.M5 2016-02-05 09:56:38 +00:00
Dave Syer
9aeb399f7e Make SpanContextHolder package private
That way it can't leak back out into public classes, particularly
in intrumentation. Such use cases should use TraceAccessor or
Tracer exclusively.
2016-02-05 06:33:40 +00:00
Dave Syer
ad97be2fa6 Remove remaining public accesses of SpanContextHolder
Hystrix is complex and the stacks get very deep. It turns out that
it is also rather stateful, so order of tests affects the outcomes.
Long story short: if you set the concurrency strategy it infects
other tests (like the TraecCommandTests), which then have to assert
slightly more carefully.
2016-02-04 17:22:10 +00:00
Dave Syer
7f975c0ff8 Remove redundant SpanContextHolder access in TraceFilter
The TraceFilter should clean up its own spans. It should never
need to use the SpanContextHolder directly.

There was a test that needed it inserted instead.
2016-02-04 13:28:22 +00:00
Dave Syer
3703452626 Guard against null sampler
If user passes in a null sampler we'll just asume it was the
default.
2016-02-04 13:28:09 +00:00
Dave Syer
ff08e3d518 Remove redunant method 2016-02-04 13:14:42 +00:00
Dave Syer
7f012ac02c Introduce SpanContext as internal detail of SpanContextHolder
The fact that a Span was active when a new one is created needs
to be recorded, but it doesn't seem to belong in the Span. However
the DefaultTracer can call other methods on the SpanContextHolder
and that's what this change does (with package private methods).

There are still some usages of the public methods in
SpanContextHolder which I'd like to stamp out as a separate issue.

Fixes gh-141
2016-02-04 12:30:25 +00:00
Dave Syer
e819881be8 Add test to assert auto close behaviour 2016-02-04 12:30:02 +00:00
Dave Syer
9bfe364518 SamplerConfiguration -> SamplerProperties
Plus tidy up docs a bit
2016-02-02 16:15:35 +00:00
Marcin Grzejszczak
055137bb72 [#50] Removed FRB.
fixes #50
2016-02-02 11:46:34 +01:00
Dave Syer
948d9e7886 Ensure sampled traces are exportable in test 2016-02-02 08:34:45 +00:00
Dave Syer
d8b72473d1 Ensure sampler is called with the new span if it is to be started 2016-02-01 18:01:34 +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
12620a4725 Fix NPE in TracePreZuulFilter
Fixes gh-135
2016-01-30 16:47:23 +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
4f3c731d37 Fix trace filter so async requests are handled properly
Previously, if a trace id came into the filter from the caller and
the controller was async, the span context was not properly managed
resulting in warnings in logs.

Fixes gh-137
2016-01-30 12:19:07 +00:00
Dave Syer
78365fe3c3 Fix test that fails because we asert a duration 2016-01-28 12:04:56 +00:00
Dave Syer
ab1fd1c234 Removes message propagating interceptor
Now that the span data is stored in a header it is safe to remove
the slightly clunky propagation implentation that used a subclass.

Also removed the Stomp* features because they were diverging from
the mainstream integration support and no-one seems to understand
why they are needed. If the original author of #96 can explain
why they were needed we can ask for a new PR to re-instate a version
that works with the new model.
2016-01-26 13:00:07 +00:00
Marcin Grzejszczak
2ef5ba2a80 Fixed checkstyle issues 2016-01-26 13:50:45 +01:00
Dave Syer
5e2c0e9bd4 Use Message headers to propagate span not thread local
Otherwise we can end up closing spans that we shouldn't, or not
closing ones that we should.
2016-01-26 12:43:27 +00:00
Marcin Grzejszczak
0fc2c1a809 [#132] Fixed closing of spans in messaging
fixes #132
2016-01-26 12:57:34 +01:00
Marcin Grzejszczak
0ff1cf92bd [#128] Added spans for messaging
fixes #128
2016-01-25 15:57:28 +01: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
Adrian Cole
d83e0dea3c Merge pull request #129 from spring-cloud/dots
Changes http key delimiter to dot and adds size keys
2016-01-24 17:57:01 +01:00
Dave Syer
205d9c1a84 Move stream header environment properties to stream library 2016-01-24 11:25:31 +00:00
Adrian Cole
9417110e90 Changes http key delimiter to dot and adds size keys 2016-01-23 17:28:12 +01:00
Marcin Grzejszczak
301c6b230a [#99] Basic Health Metrics
Changes following review
    - Reusing CounterService to automatically profit from Dropwizard if present
    - NoOp is the default impl for SpanReporterService
    - SpanReporterService has configurable metric names (it's enough to change the
    name to 'meter.a.b.c' to profit from Dropwizard's meters)

    Fixes gh-99
2016-01-21 15:55:26 +01:00
Dave Syer
3a4554d8c1 Tidy up conditionals in trace autoconfig 2016-01-21 14:05:16 +00:00
Dave Syer
0bbd7cb70f Fix messaging and ribbon instrumentation for hex headers
It still feels brittle because it's up to the suthor of the
instrumentation. This patches all the places where we were still
using Long instead of Long.toHexString(..).

Fixes gh-125
2016-01-21 09:48:34 +00:00
Marcin Grzejszczak
10325e9547 Removed obsolete converter 2016-01-20 15:47:29 +01:00
Marcin Grzejszczak
72574f31ed Added comment with the difference between OpenTracing Span and Sleuth's Span 2016-01-20 14:53:16 +01:00
Marcin Grzejszczak
d22a497b0c TraceAccessor -> SpanAccessor 2016-01-20 14:39:08 +01:00
Marcin Grzejszczak
3c5625a9de Changed sampler method to be consistent with open tracing API
https://github.com/opentracing/opentracing-python/blob/master/example/zipkin_like/sampler.py#L36
2016-01-20 13:05:29 +01:00
Marcin Grzejszczak
2698e0b9c2 Added Redundant Imports rule for checkstyle 2016-01-20 12:55:19 +01:00
Marcin Grzejszczak
7b6a533498 Fixed checkstyle issues 2016-01-20 12:36:38 +01:00
Marcin Grzejszczak
d5b523d021 Converted MilliSpan to Span. Removed the interface 2016-01-20 10:52:02 +01:00
Marcin Grzejszczak
797ca4f50c Removed Trace 2016-01-20 10:50:43 +01:00
Adrian Cole
9bcab5b0c6 Updates to zipkin-java 0.4.3 2016-01-20 12:22:18 +08:00
Dave Syer
da60403321 Add message keys to TraceKeys
User can now configure message headers to be added using
spring.sleuth.keys.message.headers.

Fixes gh-119

Also a bunch of cosmetic changes (imports etc).
2016-01-19 13:40:35 +00:00
Dave Syer
fa5fab9175 Make TraceKeys configurable
User can now configure additional HTTP headers to tag via
spring.sleuth.keys.http.headers.

Fixes gh-118
2016-01-19 10:07:35 +00:00
Marcin Grzejszczak
6b88e97b9c TraceManager -> Tracer; startSpan -> startTrace 2016-01-19 09:02:09 +01:00
Adrian Cole
da065504a7 Merge pull request #115 from spring-cloud/pare-down-http
Pares down default http tags, but opens apis for adding more
2016-01-19 12:50:56 +08:00
Marcin Grzejszczak
11c0846353 [#86] Removes the sampler param. Fixed #86 2016-01-18 17:06:09 +01:00
Adrian Cole
860622fb57 Pares down default http tags, but opens apis for adding more
Previously, sleuth logged more data than necessary. This led to issues
including spans approaching megabytes each. This pares down default keys
to a minimal set, but allows users to opt-into logging more by extending
`TraceFilter`.
2016-01-18 21:48:59 +08:00
Marcin Grzejszczak
82ed9f78a1 [#106] Converted UUID to Long
- Changed Random instantiation to a shared Random
- Changed the name of the converter
- Changed generator into random
- Span id is now non-nullable.
    - it gets generated in the http filter if it's not there
    - it's generated in the spring-integration channels if it wasn't set
2016-01-18 14:38:09 +01:00
Marcin Grzejszczak
57d9e62a66 [#104] Refactoring the flickering test 2016-01-15 14:53:35 +01:00
Marcin Grzejszczak
c6b2369a45 [#84] Adding missing name to the filter. Fixes #84 2016-01-13 20:50:55 +01:00
Dave Syer
368d1ccae7 Rename some of the core API concepts
E.g. annotation -> tag, timelineAnnotation -> log

See gh-98
2016-01-12 17:39:58 +00:00
Adrian Cole
84d2706a57 Updates to latest zipkin and brave, removing Scribe dependency
Recent versions of zipkin and brave operate with http instead of scribe.
This changes the implementation accordingly, as well adds a sampler to
the POST endpoint.

A notable impact is that we no longer require a collector process, as
the zipkin server's POST endpoint is a collector.
2016-01-12 21:58:48 +08:00
Marcin Grzejszczak
877f401231 Unified test naming 2016-01-11 17:52:16 +01:00