Tracer emits although using `AlwaysOffSampler`
See original GitHub issueI’d expect that using AlwaysOffSampler
the tracer is silent, but it in fact spams the console. Here is a minimal example:
from opencensus.trace import tracer as tracer_module
from opencensus.trace.samplers import AlwaysOffSampler
tracer = tracer_module.Tracer(sampler=AlwaysOffSampler())
with tracer.span(name='should-not-trace') as span:
pass
It prints:
[SpanData(name='should-not-trace', context=<opencensus.trace.span_context.SpanContext object at 0x7ff7ac107978>, span_id='4ac72045f7064ac2', parent_span_id=None, attributes={}, start_time='2018-11-22T08:42:32.096948Z', end_time='2018-11-22T08:42:32.096951Z', child_span_count=0, stack_trace=None, time_events=[], links=[], status=None, same_process_as_parent_span=None, span_kind=0)]
Doc-string of AlwaysOffSampler
says “Do not trace any requests”. This is not what I’d expect then.
If for any reason this is the intended behavior, please suggest how I can turn tracing off completely. Thanks!
EDIT: I am on Python 3 with opencensus 0.1.5
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
OpenTelemetry C++
AlwaysOffSampler which doesn't sample any trace, regardless of upstream sampling decisions. • ParentBased which uses the parent span to make ...
Read more >Class AlwaysOffSampler - OpenTelemetry SDK
Use the one defined in @opentelemetry/sdk-trace-base instead. Sampler that samples no traces. Hierarchy. AlwaysOffSampler. Implements.
Read more >https://raw.githubusercontent.com/open-telemetry/o...
Api/README.md#introduction-to-opentelemetry-net-tracing-api) to emit activity/span instances directly. If a library is instrumented using the ...
Read more >Client Libraries — Jaeger documentation
However, now that the larger community in OpenTelemetry has caught up with ... Jaeger tracers emit various metrics about how many spans or...
Read more >Tracing SDK - mirrors_oktal/opentelemetry-specification - Gitee
Sampling · SDK Span creation; Sampler. ShouldSample; GetDescription. Built-in samplers. AlwaysOn · Tracer Provider · Tracer Creation; Shutdown · Additional Span ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Yep will add that to readme! I’ll go ahead to close this issue and feel free to reopen if you find anything else.
Thank you very much @liyanhui1228, this helps a lot. I guess it would be sufficient if you add this on/off switching somewhere in the Readme. Should be quite regularly needed to e.g. define an environment variable that allows for easy on/off of tracing.