Skip to content

Commit

Permalink
rename env var for tracing disable during bootstrapping.
Browse files Browse the repository at this point in the history
  • Loading branch information
saikonen committed Oct 18, 2023
1 parent 85a43dc commit 6d5afc6
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 8 deletions.
4 changes: 1 addition & 3 deletions metaflow/metaflow_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -403,9 +403,7 @@
ZIPKIN_ENDPOINT = from_conf("ZIPKIN_ENDPOINT")
CONSOLE_TRACE_ENABLED = from_conf("CONSOLE_TRACE_ENABLED", False)
# internal env used for preventing the tracing module from loading during Conda bootstrapping.
BOOTSTRAPPING_CONDA_ENVIRONMENT = bool(
os.environ.get("BOOTSTRAPPING_CONDA_ENVIRONMENT", False)
)
DISABLE_TRACING = bool(os.environ.get("DISABLE_TRACING", False))

# MAX_ATTEMPTS is the maximum number of attempts, including the first
# task, retries, and the final fallback task and its retries.
Expand Down
2 changes: 1 addition & 1 deletion metaflow/plugins/pypi/conda_environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ def bootstrap_commands(self, step_name, datastore_type):
# as the bootstrapping process uses the internal S3 client which would fail to import tracing
# due to the required dependencies being bundled into the conda environment,
# which is yet to be initialized at this point.
'BOOTSTRAPPING_CONDA_ENVIRONMENT=True python -m metaflow.plugins.pypi.bootstrap "%s" %s "%s" linux-64'
'DISABLE_TRACING=True python -m metaflow.plugins.pypi.bootstrap "%s" %s "%s" linux-64'
% (self.flow.name, id_, self.datastore_type),
"echo 'Environment bootstrapped.'",
"export PATH=$PATH:$(pwd)/micromamba",
Expand Down
6 changes: 2 additions & 4 deletions metaflow/tracing/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
OTEL_ENDPOINT,
ZIPKIN_ENDPOINT,
CONSOLE_TRACE_ENABLED,
BOOTSTRAPPING_CONDA_ENVIRONMENT,
DISABLE_TRACING,
)
from functools import wraps
import contextlib
Expand Down Expand Up @@ -50,9 +50,7 @@ def wrapper_func(*args, **kwargs):
return wrapper_func


if not BOOTSTRAPPING_CONDA_ENVIRONMENT and (
CONSOLE_TRACE_ENABLED or OTEL_ENDPOINT or ZIPKIN_ENDPOINT
):
if not DISABLE_TRACING and (CONSOLE_TRACE_ENABLED or OTEL_ENDPOINT or ZIPKIN_ENDPOINT):
try:
# Overrides No-Op implementations if a specific provider is configured.
from .tracing_modules import (
Expand Down

0 comments on commit 6d5afc6

Please sign in to comment.