code: def _trace_func(func, args, kwargs, span_name=None):
      module_name = func.__module__
      qualname = func.__qualname__
  
      if not _is_tracing_enabled():
          start = time.time()
          out = func(*args, **kwargs)
          elapsed = time.time() - start
          logger.debug(f"{module_name}:{qualname} tasks: {elapsed}")
          return out
  
      if span_name is None:
          span_name = qualname
      tracer = get_tracer(module_name)
      with tracer.start_as_current_span(span_name) as span:
          import traceback
  
          callstack = "\n".join(
              [line.strip() for line in traceback.format_stack()[:-2]]
          )
          span.set_attribute("call_stack", callstack)
          span.set_attribute("qualname", qualname)
          span.set_attribute("module", module_name)
          return func(*args, **kwargs)
  
imports: import functools
  import logging
  import os
  import time
  import typing
  from typing import List
  from opentelemetry import trace, context
label_desc: Use image node_id 4 for calling a global function with example usage: _trace_func(func, args, kwargs, span_name) and returns: out, func