Added support for service discovery based Zipkin URL resolution

This commit is contained in:
Marcin Grzejszczak
2017-07-15 19:50:05 +02:00
parent 8c98386c14
commit a626632b40
3 changed files with 25 additions and 1 deletions

View File

@@ -322,6 +322,7 @@ Example of setting baggage on a span:
----
Span initialSpan = this.tracer.createSpan("span");
initialSpan.setBaggageItem("foo", "bar");
initialSpan.setBaggageItem("UPPER_CASE", "someValue");
----
===== Baggage vs. Span Tags

View File

@@ -484,6 +484,26 @@ Stream based span reporting).
spring.zipkin.locator.discovery.enabled: true
----
== Sending spans to Zipkin
By default if you add `spring-cloud-starter-zipkin` as a dependency to your project,
when the span is closed, it will be sent to Zipkin over HTTP. The communication
is asynchronous. You can configure the URL by setting the `spring.zipkin.baseUrl`
property as follows:
[source,yaml]
----
spring.zipkin.baseUrl: http://192.168.99.100:9411/
----
If you want to find Zipkin via service discovery it's enough to pass the
Zipkin's service id inside the URL (example for `zipkinserver` service id)
[source,yaml]
----
spring.zipkin.baseUrl: http://zipkinserver/
----
== Span Data as Messages
You can accumulate and send span data over

View File

@@ -26,7 +26,10 @@ import org.springframework.boot.context.properties.ConfigurationProperties;
*/
@ConfigurationProperties("spring.zipkin")
public class ZipkinProperties {
/** URL of the zipkin query server instance. */
/** URL of the zipkin query server instance. You can also provide
* the service id of the Zipkin server if Zipkin's registered in
* service discovery (e.g. http://zipkinserver/)
*/
private String baseUrl = "http://localhost:9411/";
private boolean enabled = true;
private int flushInterval = 1;