8000 doc(types): Add jsdoc for breadcrumbs (#11504) · basarat/sentry-javascript@f46b29e · GitHub
[go: up one dir, main page]

Skip to content
10000

Commit f46b29e

Browse files
doc(types): Add jsdoc for breadcrumbs (getsentry#11504)
When interacting with the Breadcrumd API, I had some trouble finding the correct documentation. I retrieved my changes for the previous [PR](getsentry#11119) to make sure the JSDoc is updated with the actual doc.
1 parent 14e5373 commit f46b29e

File tree

1 file changed

+58
-1
lines changed

1 file changed

+58
-1
lines changed

packages/types/src/breadcrumb.ts

Lines changed: 58 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,70 @@
11
import type { SeverityLevel } from './severity';
22

3-
/** JSDoc */
3+
/**
4+
* Sentry uses breadcrumbs to create a trail of events that happened prior to an issue.
5+
* These events are very similar to traditional logs but can record more rich structured data.
6+
*
7+
* @link https://develop.sentry.dev/sdk/event-payloads/breadcrumbs/
8+
*/
49
export interface Breadcrumb {
10+
/**
11+
* By default, all breadcrumbs are recorded as default, which makes them appear as a Debug entry, but Sentry provides
12+
* other types that influence how the breadcrumbs are rendered. For more information, see the description of
13+
* recognized breadcrumb types.
14+
*
15+
* @summary The type of breadcrumb.
16+
* @link https://develop.sentry.dev/sdk/event-payloads/breadcrumbs/#breadcrumb-types
17+
*/
518
type?: string;
19+
20+
/**
21+
* Allowed values are, from highest to lowest:
22+
* `fatal`, `error`, `warning`, `info`, and `debug`.
23+
* Levels are used in the UI to emphasize and deemphasize the crumb. The default is `info`.
24+
*
25+
* @summary This defines the severity level of the breadcrumb.
26+
*/
627
level?: SeverityLevel;
28+
729
event_id?: string;
30+
31+
/**
32+
* Typically it is a module name or a descriptive string. For instance, `ui.click` could be used to
33+
* indicate that a click happened in the UI or flask could be used to indicate that the event originated in
34+
* the Flask framework.
35+
* @private Internally we render some crumbs' color and icon based on the provided category.
36+
* For more information, see the description of recognized breadcrumb types.
< 8000 /code>37+
* @summary A dotted string indicating what the crumb is or from where it comes.
38+
* @link https://develop.sentry.dev/sdk/event-payloads/breadcrumbs/#breadcrumb-types
39+
*/
840
category?: string;
41+
42+
/**
43+
* If a message is provided, it is rendered as text with all whitespace preserved.
44+
*
45+
* @summary Human-readable message for the breadcrumb.
46+
*/
947
message?: string;
48+
49+
/**
50+
* Contains a dictionary whose contents depend on the breadcrumb type.
51+
* Additional parameters that are unsupported by the type are rendered as a key/value table.
52+
*
53+
* @summary Arbitrary data associated with this breadcrumb.
54+
*/
1055
data?: { [key: string]: any };
56+
57+
/**
58+
* The format is a numeric (integer or float) value representing
59+
* the number of seconds that have elapsed since the Unixepoch.
60+
* Breadcrumbs are most useful when they include a timestamp, as it creates a timeline
61+
* leading up to an event expection/error.
62+
*
63+
* @note The API supports a string as defined in RFC 3339, but the SDKs only support a numeric value for now.
64+
*
65+
* @summary A timestamp representing when the breadcrumb occurred.
66+
* @link https://develop.sentry.dev/sdk/event-payloads/breadcrumbs/#:~:text=is%20info.-,timestamp,-(recommended)
67+
*/
1168
timestamp?: number;
1269
}
1370

0 commit comments

Comments
 (0)
0