withEvent

Should be able to create a new trace header with a new event in the trace state, as the key of the eventName as breadcrumbs appending onto previous breadcrumbs with the - infix if exists. And the trace parent gets updated as according to the docs

Import

1import { TraceHeader } from "@aa-sdk/core";

Usage

1const traceHeader =
2 TraceHeader.fromTraceHeader(headers) || TraceHeader.default();
3const newTraceHeader = traceHeader.withEvent("newEvent");

Parameters

eventName

string The key of the new event

Returns

TraceHeader The new trace header