1 #ifndef OPENTRACING_NOOP_H
2 #define OPENTRACING_NOOP_H
4 #include <opentracing/symbols.h>
5 #include <opentracing/tracer.h>
6 #include <opentracing/version.h>
9 namespace opentracing
{
10 BEGIN_OPENTRACING_ABI_NAMESPACE
11 // A NoopTracer is a trivial, minimum overhead implementation of Tracer
12 // for which all operations are no-ops.
14 // The primary use of this implementation is in libraries, such as RPC
15 // frameworks, that make tracing an optional feature controlled by the
16 // end user. A no-op implementation allows said libraries to use it
17 // as the default Tracer and to write instrumentation that does
18 // not need to keep checking if the tracer instance is nil.
20 // For the same reason, the NoopTracer is the default "global" tracer
21 // (see Tracer::Global and Tracer::InitGlobal functions).
23 // WARNING: NoopTracer does not support baggage propagation.
24 OPENTRACING_API
std::shared_ptr
<Tracer
> MakeNoopTracer() noexcept
;
25 END_OPENTRACING_ABI_NAMESPACE
26 } // namespace opentracing
28 #endif // OPENTRACING_NOOP_H