Exporting NoopTracer
publicly
#3973
paulius-valiunas
started this conversation in
Ideas
Replies: 1 comment
-
I think a custom sampler would be a better fit here. But unfortunatelly samplers don't get the instrumentation scope info... The spec mentions which parameters are required input for samplers but I don't read the more input is not allowed therefore I think adding instrumentation scope should be ok. Or maybe you can decide based on span name and/or attributes given at span start already now - even this looks more like a workaround. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Some libraries (looking at you, Azure) annoyingly try to automatically enable tracing if they can
require("@opentelemetry/api")
from your dependency tree. Some of that tracing is too verbose for me as I don't want to have that many spans in my traces. I was looking for ways to disable tracing for this kind of libraries and the only feasible way that I found was creating a customTracerProvider
that looks at the library name passed intogetTracer
and either returns aNoopTracer
or the usual SDK tracer based on a whitelist/blacklist of tracer names. The problem with that isNoopTracer
is not included in the barrel file so I have to import it from@opentelemetry/api/build/src/trace/NoopTracer.js
, which I understand might change at any time because it's not supposed to be used this way. I'm proposing that this is changed and people are allowed to import it directly.Beta Was this translation helpful? Give feedback.
All reactions