Search code examples
tracezipkin

Disable Brave tracing library?


I'm setting up an application that uses Brave to perform tracing of processing spans. Configuring it to send traces is relatively straightforward, but what I want to do is make tracing optional - that is, most of the time, nobody wants or cares about the tracing data and zipkin isn't even running.

For those sorts of configurations, it seems like one option is to implement zipkin2.reporter.Sender with a null implementation, but that seems harder than it needs to be, and still a lot of the machinery keeps running for no reason.


Solution

  • You can just setNoop to true on Trace

    setNoop​(boolean noop)  
    Set true to drop data and only return noop spans regardless of sampling policy.