@tigorhutasuhut/telemetry-js - v0.7.3
    Preparing search index...

    Function extractSpan

    • Extract a Span from workflow params using the globally registered textmap propagator.

      This is a convenience wrapper around extractContext that also retrieves the remote span from the extracted context via trace.getSpan(). The returned span is a non-recording remote span suitable for use as a parent option in withTrace or trace.setSpan().

      Type Parameters

      • T extends Record<string, unknown>

      Parameters

      • params: T

        The params object containing propagation headers.

      Returns {
          context: Context;
          params: Omit<T, "traceparent" | "tracestate" | "baggage">;
          span: Span | undefined;
      }

      An object with the extracted span (if any), context, and cleaned params.

      const { params: clean, span: parentSpan } = extractSpan(event.payload);
      await withTrace(
      async (span) => { ... },
      { parent: parentSpan, name: "child-operation" },
      );