UNPKG

3.64 kBTypeScriptView Raw
1import type { SeverityLevel } from './severity';
2/**
3 * Sentry uses breadcrumbs to create a trail of events that happened prior to an issue.
4 * These events are very similar to traditional logs but can record more rich structured data.
5 *
6 * @link https://develop.sentry.dev/sdk/event-payloads/breadcrumbs/
7 */
8export interface Breadcrumb {
9 /**
10 * By default, all breadcrumbs are recorded as default, which makes them appear as a Debug entry, but Sentry provides
11 * other types that influence how the breadcrumbs are rendered. For more information, see the description of
12 * recognized breadcrumb types.
13 *
14 * @summary The type of breadcrumb.
15 * @link https://develop.sentry.dev/sdk/event-payloads/breadcrumbs/#breadcrumb-types
16 */
17 type?: string;
18 /**
19 * Allowed values are, from highest to lowest:
20 * `fatal`, `error`, `warning`, `info`, and `debug`.
21 * Levels are used in the UI to emphasize and deemphasize the crumb. The default is `info`.
22 *
23 * @summary This defines the severity level of the breadcrumb.
24 */
25 level?: SeverityLevel;
26 event_id?: string;
27 /**
28 * Typically it is a module name or a descriptive string. For instance, `ui.click` could be used to
29 * indicate that a click happened in the UI or flask could be used to indicate that the event originated in
30 * the Flask framework.
31 * @private Internally we render some crumbs' color and icon based on the provided category.
32 * For more information, see the description of recognized breadcrumb types.
33 * @summary A dotted string indicating what the crumb is or from where it comes.
34 * @link https://develop.sentry.dev/sdk/event-payloads/breadcrumbs/#breadcrumb-types
35 */
36 category?: string;
37 /**
38 * If a message is provided, it is rendered as text with all whitespace preserved.
39 *
40 * @summary Human-readable message for the breadcrumb.
41 */
42 message?: string;
43 /**
44 * Contains a dictionary whose contents depend on the breadcrumb type.
45 * Additional parameters that are unsupported by the type are rendered as a key/value table.
46 *
47 * @summary Arbitrary data associated with this breadcrumb.
48 */
49 data?: {
50 [key: string]: any;
51 };
52 /**
53 * The format is a numeric (integer or float) value representing
54 * the number of seconds that have elapsed since the Unixepoch.
55 * Breadcrumbs are most useful when they include a timestamp, as it creates a timeline
56 * leading up to an event expection/error.
57 *
58 * @note The API supports a string as defined in RFC 3339, but the SDKs only support a numeric value for now.
59 *
60 * @summary A timestamp representing when the breadcrumb occurred.
61 * @link https://develop.sentry.dev/sdk/event-payloads/breadcrumbs/#:~:text=is%20info.-,timestamp,-(recommended)
62 */
63 timestamp?: number;
64}
65/** JSDoc */
66export interface BreadcrumbHint {
67 [key: string]: any;
68}
69export interface FetchBreadcrumbData {
70 method: string;
71 url: string;
72 status_code?: number;
73 request_body_size?: number;
74 response_body_size?: number;
75}
76export interface XhrBreadcrumbData {
77 method?: string;
78 url?: string;
79 status_code?: number;
80 request_body_size?: number;
81 response_body_size?: number;
82}
83export interface FetchBreadcrumbHint {
84 input: any[];
85 data?: unknown;
86 response?: unknown;
87 startTimestamp: number;
88 endTimestamp: number;
89}
90export interface XhrBreadcrumbHint {
91 xhr: unknown;
92 input: unknown;
93 startTimestamp: number;
94 endTimestamp: number;
95}
96//# sourceMappingURL=breadcrumb.d.ts.map
\No newline at end of file