Skip to content

toTraceHeader

Should be able to convert the trace header to the format that is used in the headers of an http request

Import

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

Usage

const traceHeader =
  TraceHeader.fromTraceHeader(headers) || TraceHeader.default();
const headers = traceHeader.toTraceHeader();

Returns

{traceparent: string, tracestate: string} The trace header in the format of a record, used in our http client