-
Notifications
You must be signed in to change notification settings - Fork 153
/
Copy pathTracerInterface.ts
34 lines (32 loc) · 1.09 KB
/
TracerInterface.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import type {
CaptureLambdaHandlerOptions,
CaptureMethodOptions,
HandlerMethodDecorator,
MethodDecorator,
} from './types';
import type { Segment, Subsegment } from 'aws-xray-sdk-core';
interface TracerInterface {
addErrorAsMetadata(error: Error, remote?: boolean): void;
addResponseAsMetadata(data?: unknown, methodName?: string): void;
addServiceNameAnnotation(): void;
annotateColdStart(): void;
captureAWS<T>(aws: T): void | T;
captureAWSv3Client<T>(service: T): void | T;
captureAWSClient<T>(service: T): void | T;
captureLambdaHandler(
options?: CaptureLambdaHandlerOptions
): HandlerMethodDecorator;
captureMethod(options?: CaptureMethodOptions): MethodDecorator;
getSegment(): Segment | Subsegment | undefined;
getRootXrayTraceId(): string | undefined;
isTraceSampled(): boolean;
isTracingEnabled(): boolean;
putAnnotation: (key: string, value: string | number | boolean) => void;
putMetadata: (
key: string,
value: unknown,
namespace?: string | undefined
) => void;
setSegment(segment: Segment | Subsegment): void;
}
export { TracerInterface };