-
Notifications
You must be signed in to change notification settings - Fork 114
Method to reset the global tracer? #119
Comments
opentracing::Tracer::InitGlobal({}); However: |
Or use InitGlobal(nullptr) I think the intention of IsGobalTracerRegistered was to query whether a global tracer was ever registered, but maybe @MikeGoldsmith can clarify? |
The intention was to enable an application, or other library, to detect if a tracer has explicitly registered. Shutdown / cleanup wasn't part of the original design. I think having a |
Wouldn't returning a null pointer (default-constructed |
IsGlobalTracerRegistered uses an internal bool to determine if a tracer has been registered and is set when InitGlobal is called. Calling InitGlobal(nullptr) would not reset the flag. We have a bool property to determine if a tracer was registered because we want to know if the app intentionally registers a tracer, and is not just a null or default noop tracer. Adding |
Hello,
Is it a conscious choice not to have provided a ResetGlobal method or equivalent on the tracer?
I suppose the shared_ptr is cleaned up at global shutdown of an application, but that limits the opportunities for "controlled" init/cleanup of the singleton.
Would this be the preferred way to do it with the current opentracing code?
Thank you,
Regards, Emmanuel.
The text was updated successfully, but these errors were encountered: