You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on May 23, 2023. It is now read-only.
In .NET, most new libraries/frameworks provide instrumentation hooks via an observer pattern through a type called DiagnosticSource. Having a "no-tracer"-check (e.g. tracer.isEnabled()) would allow us to not even create a subscription and would therefore result in a zero-overhead situation.
It's already possible to do this by checking the tracer instance type but this is pretty ugly especially due to how GlobalTracer works in Java/C# (it wraps the underlying tracer):
publicstaticboolIsNoopTracer(ITracertracer){// This will be "if (tracer is NoopTracer)" once an open PR in opentracing-csharp gets merged.if(tracer==NoopTracerFactory.Create())returntrue;// There's currently no way to check the underlying tracer on the instance // so we have to check the static method.if(tracerisGlobalTracer&&!GlobalTracer.IsRegistered())returntrue;returnfalse;}
Continuing the discussion from opentracing/opentracing.io#31
cc: @dkuebric @bensigelman @bogdandrutu @yurishkuro
The text was updated successfully, but these errors were encountered: