Skip to content

Commit

Permalink
fixup! Add trace ID to clipboard debug info and title bar
Browse files Browse the repository at this point in the history
  • Loading branch information
HakonSohoel committed Nov 12, 2024
1 parent e37bd6c commit 330a035
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/ert/gui/main_window.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
from ert.gui.tools.plugins import PluginHandler, PluginsTool
from ert.gui.tools.workflows import WorkflowsTool
from ert.plugins import ErtPluginManager
from ert.trace import getTraceID
from ert.trace import get_trace_id

BUTTON_STYLE_SHEET: str = """
QToolButton {
Expand Down Expand Up @@ -80,7 +80,7 @@ def __init__(
self.log_handler = log_handler

self.setWindowTitle(
f"ERT - {config_file} - {find_ert_info()} - {getTraceID()[:8]}"
f"ERT - {config_file} - {find_ert_info()} - {get_trace_id()[:8]}"
)
self.plugin_manager = plugin_manager
self.central_widget = QFrame(self)
Expand Down
4 changes: 2 additions & 2 deletions src/ert/gui/simulation/experiment_panel.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
format_running_time,
get_ert_memory_usage,
)
from ert.trace import getTraceID
from ert.trace import get_trace_id

from ..summarypanel import SummaryPanel
from .combobox_with_description import QComboBoxWithDescription
Expand Down Expand Up @@ -386,7 +386,7 @@ def populate_clipboard_debug_info(self) -> None:
kv[field.name.replace("_", " ").capitalize()] = str(field_value)

kv["**Status**"] = ""
kv["Trace ID"] = getTraceID()
kv["Trace ID"] = get_trace_id()
kv["Running time"] = (
format_running_time(self._model.get_runtime()).split(":")[1].strip()
)
Expand Down
2 changes: 1 addition & 1 deletion src/ert/trace.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@
tracer = trace.get_tracer("ert.main")


def getTraceID() -> str:
def get_trace_id() -> str:
return trace.format_trace_id(trace.get_current_span().get_span_context().trace_id)

0 comments on commit 330a035

Please sign in to comment.