MCPcopy
hub / github.com/dataelement/Clawith / new_trace_id

Function new_trace_id

backend/app/core/logging_config.py:38–47  ·  view source on GitHub ↗

Generate a new 12-char trace ID and bind it to the current context. Intended for background tasks that run outside HTTP/WebSocket request scopes so that all log lines produced by one task execution share the same trace_id.

()

Source from the content-addressed store, hash-verified

36
37
38def new_trace_id() -> str:
39 """Generate a new 12-char trace ID and bind it to the current context.
40
41 Intended for background tasks that run outside HTTP/WebSocket request
42 scopes so that all log lines produced by one task execution share the
43 same trace_id.
44 """
45 tid = uuid4().hex[:12]
46 set_trace_id(tid)
47 return tid
48
49
50def _disable_agentbay_logger_override():

Callers 5

_tickFunction · 0.90
_execute_heartbeatFunction · 0.90
_heartbeat_tickFunction · 0.90
run_agent_oneshotFunction · 0.90

Calls 1

set_trace_idFunction · 0.85

Tested by

no test coverage detected