openzipkin / zipkin-support

repository for support questions raised as issues
4 stars 2 forks source link

what's abandon function meaning ? #45

Closed RexChengZhu closed 3 years ago

RexChengZhu commented 3 years ago

brave.span

/* Throws away the current span without reporting it. / public abstract void abandon();

why i use this function and still can see the span in zipkin. i also find out the function in TraceLoadBalancerFeignClient is this meaning don't send the span to zipkin?

codefromthecrypt commented 3 years ago

abandon only works when you created the span. For example, if you never left a reference of the span to another function you don't control. then, you can call abandon and be sure nothing later will call "finish" and report it.

In other words, abandon is only dropping the data currently recorded. something later can add data by calling span.tag() or span.finish()