New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
can you globally disable tracer via an environment variable? #1279
Comments
The only thing we have right now is
It has been on my mental todo list to move this from You could implement locally via something like: import ddtrace
import os
ddtrace.tracer.enabled = bool(os.getenv("DATADOG_TRACE_ENABLED") != "false") (ish) |
I'll official add a card to our backlog for this. |
great. yeah in these cases we're not running via ddtrace-run. can help out with a PR if needed |
cool, it could be as easy as changing this line: Line 114 in 3f8970e
enabled=asbool(get_env("trace", "enabled', default=True)) |
ha yeah that's what i was thinking :) |
Ah sweet thread. I am also wondering how to disable tracing since This info below not available in the latest version of ddtrace
This is the latest version: dd-trace-py/ddtrace/commands/ddtrace_run.py Lines 18 to 24 in a2d9f1b
Adding additional code below as mention by @brettlangdon above would be great for user who doesn't use enabled=asbool(get_env("trace", "enabled', default=True)) |
This has been resolved by #1575. Apologizes for not closing this issue sooner. https://github.com/DataDog/dd-trace-py/blob/master/ddtrace/tracer.py#L143 |
it'd be helpful for our local/test development environments if we could disable ddtrace globally via an environment variable.
i tried using
DD_TRACE_ANALYTICS_ENABLED
but that doesn't seem to do the trickalso can't find any env var in the docs or from poking around the code here:
dd-trace-py/ddtrace/tracer.py
Line 114 in 3f8970e
if it helps, our main requirement is that the traces aren't actually sent over network once done. it's still fine if the traces are instrumented locally!
The text was updated successfully, but these errors were encountered: