Skip to content

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

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

Usage

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

Parameters

eventName

string The key of the new event

Returns

TraceHeader The new trace header