From 2e558090167b7b5eeb21390c99ffefda650af0c0 Mon Sep 17 00:00:00 2001 From: buildmaster Date: Wed, 19 Apr 2017 08:37:48 +0000 Subject: [PATCH] Sync docs from 1.1.x to gh-pages --- 1.1.x/index.html | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) 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
  • Example
  • Custom SA tag in Zipkin
  • Custom service name
  • +
  • Customization of reported spans
  • Host locator
  • @@ -2017,6 +2018,31 @@ Remember not to add both peer.service tag and the SA t
    +

    Customization of reported spans

    +
    +

    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.

    +
    +
    +

    Host locator

    In order to define the host that is corresponding to a particular span we need to resolve the host name