Commit Graph

62 Commits

Author SHA1 Message Date
Marcin Grzejszczak
6b88e97b9c TraceManager -> Tracer; startSpan -> startTrace 2016-01-19 09:02:09 +01: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
Adrian Cole
a3af9de4dd Makes it possible to supply an https zipkin endpoint 2016-01-14 22:31:06 +08:00
Adrian Cole
779b32b363 Introduces HttpZipkinSpanReporter
Brave's span collector, which turned out to not be a great tool for
direct use. Brave internally creates spans before sending to its
collector, so validation is implicit. The flip side of this is using the
collector directly does not validate spans. This means it is easy to
send invalid ones, for example missing span names. The problem is more
difficult as the data is in binary (thrift).

This introduces HttpZipkinSpanReporter, which validates via zipkin-java
classes before sending on the wire. Moreover, this sends in json to make
debugging problems easier.

This does not fully remove the Brave dependency, as further work is
needed. Particularly, Brave is indirectly referenced in other code.

See https://github.com/openzipkin/zipkin-java/issues/68
See #98 (Reporter is an OpenTracing term)
2016-01-14 12:41:59 +01:00
Adrian Cole
425123df86 Updates to zipkin-java 0.4.1, particularly docker images
Zipkin 0.4.1 obviates some duplication of configuration. It is also the
first version that's published as a docker image.

By switching to the published image of zipkin-java, we can be more
consistent, as `spring-cloud-sleuth-zipkin-stream` is derived from that,
not the scala query service.
2016-01-14 11:06:19 +08: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
Marcin Grzejszczak
33fda076ad Updated with Adrian's changes 2016-01-12 16:28:21 +01: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
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
334bc7fdf7 Avoiding NPE in DiscoveryClientEndpointLocator 2015-12-30 16:35:57 +01:00
Adrian Cole
1991bb40c9 Merge pull request #74 from spring-cloud/zipkin-bump
Bumps to latest zipkin and hints about JAVA_OPTS in docker
2015-12-30 09:11:34 +08:00
Adrian Cole
b6e9a8bcac Bumps to latest zipkin and hints about JAVA_OPTS in docker 2015-12-29 17:54:17 +08:00
Adrian Cole
e3669417dd Fixes missing zipkin service name and polishes span converters.
Missing service name:

Zipkin service names were logged as null, which is invalid and led to
them showing up as "unknown" in the zipkin ui. This was due to a wiring
bug, and a special-case, which this change fixes.

The special-case was when a sleuth span had no annotations. Since zipkin
service names are attached to annotations, they are only queryable when
annotations exist. When there are no annotations, we add the "lc"
binary annotation, which makes that span attached to the correct service
in zipkin.

Polishing:

Zipkin timestamps were not always set as microseconds. This fixes that.

The de-facto label in zipkin for unknown service is "unknown". This
fixes the code, which formerly fell back to "application".

This also removes complexity in assigning timestamp and duration as we
no longer need to make pseudo-annotations "acquire" and "release".

Finally, this adds tests about above consistently to both scs-zipkin and
scs-zipkin-stream.
2015-12-29 17:10:16 +08:00
Dave Syer
ff3c39e497 Revert to snapshots 2015-12-23 09:22:21 +00:00
Dave Syer
3b0ff4b4c5 Update to 1.0.0.M4 2015-12-23 09:12:22 +00:00
Dave Syer
c11e530560 Add exportable to Span and use it to determine if data are exported
If the flag is set then annotations are collected and the data are exported
in zipkin or stream. If not you still get the correlation ids, so a purely
log-oriented solution will always have useful data on all requests.
2015-12-22 11:19:24 +00:00
Marcin Grzejszczak
8469a4e425 [#73] Added Fallback for enpoint locating. FIxes #73 2015-12-17 18:00:40 +01:00
Adrian Cole
1ec5d4f636 Cleans up unused brave refs and consolidates to zipkin docker 1.26.0 2015-12-16 11:11:09 +08:00
Dave Syer
ffa97c1f20 Big refactor of sleuth core API
Instrumentation should be able to get by with only 2
interfaces: TraceManager and TraceAccessor (the former is
not needed if you aren't starting a new Span). No explicit
access to thread locals or manipulation of thread context
is required (except locally where necessary).

A Span is enclosed by a Trace (actually a view of the complete
Trace that would be constructed remotely).
2015-12-01 14:06:04 +00:00
Adrian Cole
87ff492f2d Updates to latest zipkin/brave
Zipkin now has Span.timestamp/duration, so no more need for
"aquire/release".

This also corrects the host/endpoint logged for timeline annotations, as
it should always be the local process.
2015-11-19 11:16:59 -08:00
Dave Syer
7d3668b23f Revert to snapshots 2015-11-17 12:36:46 +00:00
Dave Syer
576424a514 Update to 1.0.0.M3 2015-11-17 12:34:31 +00:00
Dave Syer
d9bf984e5f Add spring-cloud-sleuth-stream 2015-10-12 11:09:08 +01:00
Adrian Cole
c40c62498b Sets annotation type to String, so the zipkin UI won't render base64 2015-10-09 21:19:30 -07:00
Dave Syer
4e21bf1b35 Add strategy EndpointLocator to help with service host/port location 2015-10-01 11:52:28 +01:00
Dave Syer
588c609b09 Add enabled flag as courtesy 2015-09-22 17:34:42 +01:00
Spencer Gibb
8b2593f334 Merge pull request #45 from spring-cloud/bump-zipkin
Updates docker-compose to zipkin 1.9.0
2015-09-21 10:50:50 -06:00
Dave Syer
3b305e6f8f Add basic test for zipkin span listener 2015-09-21 11:59:03 +01:00
Dave Syer
c786f81086 Fix rest template interceptors (workaround for Boot) 2015-09-21 11:59:03 +01:00
Adrian Cole
b867f29cd4 Updates docker-compose to zipkin 1.9.0 2015-09-20 13:32:17 -07:00
Adrian Cole
9e4693e379 Updates to brave 3.0.0, removing zipkin's Annotation.duration 2015-09-20 08:26:39 -07:00
Dave Syer
9612f66754 Drop back to snapshot 2015-09-10 09:02:53 +01:00
Dave Syer
614cfc243b Bump to M1 2015-09-10 09:02:16 +01:00
Spencer Gibb
78b60b605c Upgrade to brave 3.0.0-rc-1
fixes gh-33
2015-08-31 18:47:51 -06:00
Dave Syer
69751ae63e Make server_send/recv a feature of the web filter 2015-08-23 10:03:25 +01:00
Dave Syer
23868f35b7 Add starters 2015-08-23 09:56:22 +01:00
Dave Syer
8d2efdb9a9 Change a few names of things
KV annotations are just "annotations", and the "start" and "stop"
annotations in zipkin are "acquire" and "release" (since, in
particular the latter can in principle happen more than once
and not necessarily the last thing that happens to a span).

TODO: decide if TraceContextHolder is really holding a Span
or a TraceContext (or TraceScope). Maybe think of a better
name for TraceScope.
2015-08-16 10:05:05 +01:00
Dave Syer
74ee062d6d Remove unused filter (endpoint is generated in listener now) 2015-08-13 09:04:57 +01:00
Dave Syer
b4d71727bf Make span name and process id properly optional 2015-08-12 16:22:03 +01:00
Dave Syer
37d7b5bedb Split out @Async instrumentation into its own package
There was an ordering error in the conditions as well, causing the
wrong async customizers to be registered. Another issue was the
servlet async processing (request atribute not cached in all branches)
resulting in multiple spans per request.
2015-08-11 18:11:00 +01:00
Spencer Gibb
95f0dbed72 Shorten config prefix from 'spring.cloud.sleuth' to 'spring.sleuth' 2015-08-07 11:38:30 -06:00
Spencer Gibb
8afc23c5e4 Add or update copywrite 2015-08-05 17:14:14 -06:00
Dave Syer
df28936718 Finish async customizer 2015-07-31 10:12:06 +01:00
Dave Syer
d38598467c Polish async support
An @Async method should start a new trace. Still not finished that bit
because if the user also customizes the async post processor there will
be a clash.

Biggest change here is better support for async web requests.
Each async request goes through the TraceFilter multiple times so you
have to re-attach to the span in the request if there is one.
2015-07-31 09:38:52 +01:00
Dave Syer
15db080542 Stop using Brave client/server senders in favour of the collector
Directly using the collector gives us more control of the annotations.
The main improvement/change here is that we need to send the span
name and parent details downstream as well as the span id. It's not
logically required by the trace model, but zipkin needs it, so it
can set annotations on the parent span (server recv/send).
2015-07-29 17:27:33 +01:00
Dave Syer
af03054573 Separate parent and child a bit more in ZipkinSpanListener 2015-07-29 13:52:31 +01:00
Dave Syer
145cc641c2 Simplfy some of the core API interfaces and add javadocs 2015-07-29 10:37:44 +01:00
Spencer Gibb
eb397417cc fixed missing module 2015-07-28 16:21:50 -06:00
Spencer Gibb
e45cd6bc74 remove unused import 2015-07-28 15:54:48 -06:00