getTraceId static method

String getTraceId(
  1. IContext? context
)

Extracts trace id from execution context.

  • context execution context to trace execution through call chain. Returns a trace id or null if it is not defined. See IContext

Implementation

static String getTraceId(IContext? context) {
  if (context == null) {
    return "";
  }
  var traceId = context.get("trace_id") ?? context.get("traceId");
  return traceId != null ? "" + traceId : "";
}