Skip to content

Commit

Permalink
Add params to connect to zipkin tracing platform
Browse files Browse the repository at this point in the history
  • Loading branch information
darinyu committed Nov 13, 2023
1 parent 6badc1d commit 5ece011
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
4 changes: 4 additions & 0 deletions metaflow/metaflow_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -398,9 +398,13 @@

OTEL_ENDPOINT = from_conf("OTEL_ENDPOINT")
ZIPKIN_ENDPOINT = from_conf("ZIPKIN_ENDPOINT")
# URL template for tracing links in the UI.
# An example value is "https://zipkin.example.com/trace/{trace_id}".
TRACING_URL_TEMPLATE = from_conf("TRACING_URL_TEMPLATE")
CONSOLE_TRACE_ENABLED = from_conf("CONSOLE_TRACE_ENABLED", False)
# internal env used for preventing the tracing module from loading during Conda bootstrapping.
DISABLE_TRACING = bool(os.environ.get("DISABLE_TRACING", False))
DEBUG_TRACING = bool(os.environ.get("DEBUG_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
8 changes: 7 additions & 1 deletion metaflow/runtime.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

from . import get_namespace
from .metadata import MetaDatum
from .metaflow_config import MAX_ATTEMPTS, UI_URL
from .metaflow_config import MAX_ATTEMPTS, UI_URL, TRACING_URL_TEMPLATE
from .exception import (
MetaflowException,
MetaflowInternalError,
Expand Down Expand Up @@ -310,6 +310,12 @@ def execute(self):
)
else:
self._logger("Done!", system_msg=True)
if TRACING_URL_TEMPLATE and tracing.get_trace_id():
tracing_log_template = "Tracing URL is %s" % TRACING_URL_TEMPLATE
self._logger(
tracing_log_template.format(trace_id=tracing.get_trace_id()),
system_msg=True,
)
elif self._clone_only:
self._logger(
"Clone-only resume complete -- only previously successful steps were "
Expand Down

0 comments on commit 5ece011

Please sign in to comment.