diff --git a/README.adoc b/README.adoc index 4b30082a6..ab8207b34 100644 --- a/README.adoc +++ b/README.adoc @@ -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 diff --git a/docs/src/main/asciidoc/spring-cloud-sleuth.adoc b/docs/src/main/asciidoc/spring-cloud-sleuth.adoc index f1175c263..bbf232e53 100644 --- a/docs/src/main/asciidoc/spring-cloud-sleuth.adoc +++ b/docs/src/main/asciidoc/spring-cloud-sleuth.adoc @@ -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 diff --git a/spring-cloud-sleuth-zipkin/src/main/java/org/springframework/cloud/sleuth/zipkin/ZipkinProperties.java b/spring-cloud-sleuth-zipkin/src/main/java/org/springframework/cloud/sleuth/zipkin/ZipkinProperties.java index 1144d0d0c..037a9dc2f 100644 --- a/spring-cloud-sleuth-zipkin/src/main/java/org/springframework/cloud/sleuth/zipkin/ZipkinProperties.java +++ b/spring-cloud-sleuth-zipkin/src/main/java/org/springframework/cloud/sleuth/zipkin/ZipkinProperties.java @@ -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;