-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
/
event.ts
83 lines (79 loc) · 2.29 KB
/
event.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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
import { Attachment } from './attachment';
import { Breadcrumb } from './breadcrumb';
import { Contexts } from './context';
import { DebugMeta } from './debugMeta';
import { Exception } from './exception';
import { Extras } from './extra';
import { Measurements } from './measurement';
import { Primitive } from './misc';
import { Request } from './request';
import { CaptureContext } from './scope';
import { SdkInfo } from './sdkinfo';
import { Severity, SeverityLevel } from './severity';
import { Span } from './span';
import { Thread } from './thread';
import { TransactionNameChange, TransactionSource } from './transaction';
import { User } from './user';
/** JSDoc */
export interface Event {
event_id?: string;
message?: string;
timestamp?: number;
start_timestamp?: number;
// eslint-disable-next-line deprecation/deprecation
level?: Severity | SeverityLevel;
platform?: string;
logger?: string;
server_name?: string;
release?: string;
dist?: string;
environment?: string;
sdk?: SdkInfo;
request?: Request;
transaction?: string;
modules?: { [key: string]: string };
fingerprint?: string[];
exception?: {
values?: Exception[];
};
breadcrumbs?: Breadcrumb[];
contexts?: Contexts;
tags?: { [key: string]: Primitive };
extra?: Extras;
user?: User;
type?: EventType;
spans?: Span[];
measurements?: Measurements;
debug_meta?: DebugMeta;
// A place to stash data which is needed at some point in the SDK's event processing pipeline but which shouldn't get sent to Sentry
sdkProcessingMetadata?: { [key: string]: any };
transaction_info?: {
source: TransactionSource;
changes: TransactionNameChange[];
propagations: number;
};
threads?: {
values: Thread[];
};
}
/**
* The type of an `Event`.
* Note that `ErrorEvent`s do not have a type (hence its undefined),
* while all other events are required to have one.
*/
export type EventType = 'transaction' | 'profile' | undefined;
export interface ErrorEvent extends Event {
type: undefined;
}
export interface TransactionEvent extends Event {
type: 'transaction';
}
/** JSDoc */
export interface EventHint {
event_id?: string;
captureContext?: CaptureContext;
syntheticException?: Error | null;
originalException?: Error | string | null;
attachments?: Attachment[];
data?: any;
}