Skip to content

Commit

Permalink
add debug_tracing flag and silence tracing importerrors by default (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
saikonen authored Oct 31, 2023
1 parent 0557ce9 commit 79b6908
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion metaflow/metaflow_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@
###
# Debug configuration
###
DEBUG_OPTIONS = ["subcommand", "sidecar", "s3client"]
DEBUG_OPTIONS = ["subcommand", "sidecar", "s3client", "tracing"]

for typ in DEBUG_OPTIONS:
vars()["DEBUG_%s" % typ.upper()] = from_conf("DEBUG_%s" % typ.upper(), False)
Expand Down
6 changes: 5 additions & 1 deletion metaflow/tracing/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
ZIPKIN_ENDPOINT,
CONSOLE_TRACE_ENABLED,
DISABLE_TRACING,
DEBUG_TRACING,
)
from functools import wraps
import contextlib
Expand Down Expand Up @@ -65,4 +66,7 @@ def wrapper_func(*args, **kwargs):
)

except ImportError as e:
print(e.msg, file=sys.stderr)
# We keep the errors silent by default so that having tracing environment variables present
# does not affect users with no need for tracing.
if DEBUG_TRACING:
print(e.msg, file=sys.stderr)

0 comments on commit 79b6908

Please sign in to comment.