// Copyright Abridged, Inc. 2021,2024. All Rights Reserved. // Node module: @collabland/aws // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT import {XRayServiceClient} from './xray.client.js'; export interface TraceId { version: number; timestamp: string; id: string; } export interface Subsegment extends Record { id: string; name: string; start_time: number; end_time?: number; in_progress?: boolean; http?: { request?: Record; response?: Record; }; readonly subsegments: Subsegment[]; } export interface Segment extends Subsegment { trace_id: string; parent_id?: string; origin?: string; } export const AWS_TRACE_ID = 'x-amzn-trace-id'; export const AWS_REQUEST_ID = 'x-amz-request-id'; export interface XRayInstrumented { xray?: XRayServiceClient; enableXRay(): void | Promise; } export function isXRayInstrumented(inst: object): inst is XRayInstrumented { return typeof (inst as Record).enableXRay === 'function'; }