-
Notifications
You must be signed in to change notification settings - Fork 61
Description
From brave documentation:
If you are in a situation where you need to turn off tracing at runtime, invoke
tracing.setNoop(true)
. This will turn any new spans into "noop" spans, and drop any data untiltracing.setNoop(false)
is invoked.
The main challenge here (as of PHP method visibility is per class and not per package as package don't exist) is to be able to change the state of the tracer
through the tracing
object and not being able to change it by itself.
Idea 1: Create a new tracer based on the old one (something like Tracer::withNoop(true|false)
) and override it in the tracing. That will make it required to inject tracing
in all dependencies that might require the tracer
.
Idea 2: Create an object for holding the state of noop
across Tracing
, Tracer
and Propagation
.
What do you think? @cc5092 @beberlei @felixfbecker