Commit Graph

363 Commits

Author SHA1 Message Date
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
Marcin Grzejszczak
4d3300aab6 Reverting the change with DirtiesContext 2016-01-11 12:02:56 +01:00
Marcin Grzejszczak
d038e7b0cb Trying to fix Hystrix stalling test 2016-01-11 11:58:23 +01:00
Marcin Grzejszczak
d8248d23c5 Added integration tests on integration profile 2016-01-08 23:28:10 +01:00
Marcin Grzejszczak
9a8dc17d8c [#89] Initial approach to the integration tests
- Fixed the tests
- Updated surefire
- Added integration tests (for the moment ignored)
- Fixed wrong surefire setup
2016-01-08 19:09:37 +01:00
Marcin Grzejszczak
ee9594ea96 Added missing TODO 2016-01-07 12:44:39 +01:00
Marcin Grzejszczak
3b6b49fc87 Added test for messaging template and sleuth 2016-01-07 12:43:19 +01:00
Marcin Grzejszczak
640ad4c6f7 [#85] Percentage Based Sampler implementation
fixes #85
- Updated maven setup to support jdk8 in tests
2016-01-06 10:26:13 +01:00
Marcin Grzejszczak
5a1f32c92c Refactored Channel Interceptor code to remove duplications 2016-01-04 16:37:03 +01:00
Marcin Grzejszczak
7ed53116fd Refactored Stomp Propagation Channel tests 2016-01-04 15:54:47 +01:00
Marcin Grzejszczak
04ea3c6b79 Refactored tests for STOMP 2016-01-04 15:33:52 +01:00
Marcin Grzejszczak
502b6b1f85 Merged Support for STOMP messages over websocket
- Merge branch 'master' of https://github.com/gauravrmazra/spring-cloud-sleuth into gauravrmazra-master
- Test scope removed for dependency. Needed for stomp message interceptor support
- Removed unused import from integration test
- Integration tests for TraceStompMessageContextChannelInterceptor
- Refactored code and added integration test for TraceStompMessageChannelInterceptor
- Fix for method which was not available in jdk1.7
- Fix build fail error due to new changes for stomp messages
- Support for STOMP messages over websocket
2016-01-04 10:16:12 +01:00
Dave Syer
55cd5afcb6 Catch exception in filter chain and use it to set status in span
When a controller throws an exception the servlet container will
eventually set the response status to 500, but it is still 200
generally when the filter chain finishes, unless we catch the
exception and do something with it.

Fixes gh-57
2015-12-31 13:38:16 +00:00
Dave Syer
75a5ba25fd Only add response headers once 2015-12-31 12:35:06 +00:00
Dave Syer
9bf19caf07 Add default log pattern for all apps
It goes in the defaultProperties source (appending to the existing
one if possible). That way user can override easily.

Fixes gh-87
2015-12-31 11:09:22 +00:00