Now that Endpoint has ipv6, the factory method is even worse than it
was before. This switches to a builder instead.
Note: Endpoint now has a nice toString which should help debugging.
* Use StreamListener for coercing messages from JSON `Span`
Rely on the `contentType` header of the transported message to
tell Spring Cloud Stream how to coerce the message to `Span`.
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
This moves to changes made in preparation of zipkin 1.0.
Here are the notables:
* Zipkin has autoconfiguration modules, where maven artifacts have the prefix 'zipkin-autoconfigure-X'
* Zipkin's ui now shares a version with everything else
* Zipkin now namespaces packages and configuration. ex zipkin.storage.X as opposed to zipkin.X
* All autoconfiguration classes are prefixed `Zipkin` to be easier to find
* Zipkin binds components like StorageComponent, as opposed to individual classes like SpanStore.
* Health checks are under the scope "zipkin" and broken down by component
* UI responsiveness is better by conditionally caching names queries for 5 minutes
* New `Collector` class, which makes logging and metrics patterns the same regardless of transport
This important in so far that it allows us to do metrics. The actual
implementation of stream metrics is something we can work on after 1.0
if there's a time crunch.
Notably, this removes the accidental transient dependency on scala, by
removing the dependency on `zipkin-cassandra-core`. Related classes have
been vendored into `storage-cassandra`.
This also splits out `CollectorSampler` as its own thing and introduces
two options for instrumentation sampling:
* `BoundaryTraceIdSampler` - For high-volume sites, based on Finagle
* `CountingTraceIdSampler` - Trades lower performance for high accuracy
This updates to the latest release. Beyond bug fixes, there are some
notable changes:
* storage: writes are now via AsyncSpanConsumer
* storage: added elasticsearch
* zipkin-ui: constrains start time to look for traces
* zipkin-ui: assets set cache headers, increasing responsiveness
* core: debug logging available for zipkin.internal.DependencyLinker
Notably, this removes the "zipkin-web" dependency, as the UI is now
collocated on zipkin-server.
Other notable changes are Cassandra and Kafka support, as well removing
the Brave dependency.
- 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
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.
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.
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.
Still not quite working:
$ docker-compose -f docker-compose.yml -f docker-compose.zipkin.yml up
everything starts up fine (once the database is initialized), but
the zipkin server is not listening to rabbit (and there are errors
in the logs).
@EnableZipkinStreamServer and bind to a Spring Cloud Stream message
broker. That's it. The default span store is in memory, but Zipkin
also supports MySQL (and Cassandra coming soon).