Skip to content

Commit 8342523

Browse files
authored
feat(types): add profile envelope item type (#6468)
* feat(profiling): add profile envelope item type * feat(profiling): add data category * feat(profiling): add profiletype to event.ts * feat(types): add itemheader profile
1 parent 7a35088 commit 8342523

File tree

4 files changed

+8
-4
lines changed

4 files changed

+8
-4
lines changed

packages/types/src/datacategory.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,6 @@ export type DataCategory =
1717
// Session update events
1818
| 'session'
1919
// SDK internal event, like client_reports
20-
| 'internal';
20+
| 'internal'
21+
// Profile event type
22+
| 'profile';

packages/types/src/envelope.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ export type EnvelopeItemType =
2626
| 'sessions'
2727
| 'transaction'
2828
| 'attachment'
29-
| 'event';
29+
| 'event'
30+
| 'profile';
3031

3132
export type BaseEnvelopeHeaders = {
3233
[key: string]: unknown;
@@ -48,7 +49,7 @@ type BaseEnvelope<EnvelopeHeader, Item> = [
4849
];
4950

5051
type EventItemHeaders = {
51-
type: 'event' | 'transaction';
52+
type: 'event' | 'transaction' | 'profile';
5253
};
5354
type AttachmentItemHeaders = {
5455
type: 'attachment';

packages/types/src/event.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ export interface Event {
5555
}
5656

5757
/** JSDoc */
58-
export type EventType = 'transaction';
58+
export type EventType = 'transaction' | 'profile';
5959

6060
/** JSDoc */
6161
export interface EventHint {

packages/utils/src/envelope.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,7 @@ const ITEM_TYPE_TO_DATA_CATEGORY_MAP: Record<EnvelopeItemType, DataCategory> = {
133133
event: 'error',
134134
client_report: 'internal',
135135
user_report: 'default',
136+
profile: 'profile',
136137
};
137138

138139
/**

0 commit comments

Comments
 (0)