@vtex/api
Version:
VTEX I/O API client
19 lines (18 loc) • 731 B
TypeScript
import { Span } from 'opentracing';
export interface TraceInfo {
traceId?: string;
isSampled: boolean;
}
/**
* Headers that are interesting for tracing and debugging purposes
*/
export declare const INTERESTING_HEADERS: string[];
export declare function getTraceInfo(span?: Span): TraceInfo;
/**
* Do a shallow copy of a headers object and redacts sensitive information.
* Only includes headers that are in the INTERESTING_HEADERS whitelist.
*
* @param headersObj The headers object
* @param resultFieldsPrefix The prefix that will be added to each field on the result object
*/
export declare const cloneAndSanitizeHeaders: (headersObj: Record<string, any>, resultFieldsPrefix?: string) => Record<string, string>;