@Bean
+SpanAdjuster customSpanAdjuster() {
+ return span -> span.toBuilder().name(scrub(span.getName())).build();
+}
+diff --git a/1.1.x/index.html b/1.1.x/index.html index bce608485..f2a61c346 100644 --- a/1.1.x/index.html +++ b/1.1.x/index.html @@ -472,6 +472,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
peer.service tag and the SA t
Before reporting spans to e.g. Zipkin you can be interested in modifying that span in some way.
+ You can achieve that by using the SpanAdjuster interface.
Example of usage:
+In Sleuth we’re generating spans with a fixed name. Some users want to modify the name depending on values
+of tags. Implementation of the SpanAdjuster interface can be used to alter that name. Example:
@Bean
+SpanAdjuster customSpanAdjuster() {
+ return span -> span.toBuilder().name(scrub(span.getName())).build();
+}
+This will lead in changing the name of the reported span just before it gets sent to Zipkin.
+In order to define the host that is corresponding to a particular span we need to resolve the host name