Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Tracer emits although using `AlwaysOffSampler`

See original GitHub issue

I’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:

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:closed
  • Created 5 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

liyanhui1228commented, Nov 27, 2018

Yep will add that to readme! I’ll go ahead to close this issue and feel free to reopen if you find anything else.

cbpygitcommented, Nov 27, 2018

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.

Read more comments on GitHub >

github_iconTop 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 >
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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Post

No results found

github_iconTop Related Hashnode Post

No results found