Added support for service discovery based Zipkin URL resolution
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user