Skip to content

Commit

Permalink
ref: PR fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
mydea committed Dec 9, 2022
1 parent a2277de commit 2a68ccf
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 2 deletions.
5 changes: 4 additions & 1 deletion packages/core/src/envelope.ts
Expand Up @@ -68,7 +68,10 @@ export function createEventEnvelope(
tunnel?: string,
): EventEnvelope {
const sdkInfo = getSdkMetadataForEnvelopeHeader(metadata);
const eventType = event.type || 'event';

// TODO: Handle replay_event here
// Currently, this is done by replay, but we want to upstream this here
const eventType = event.type && event.type !== 'replay_event' ? event.type : 'event';

enhanceEventWithSdkInfo(event, metadata && metadata.sdk);

Expand Down
2 changes: 2 additions & 0 deletions packages/types/src/datacategory.ts
Expand Up @@ -10,6 +10,8 @@ export type DataCategory =
| 'error'
// Transaction type event
| 'transaction'
// Replay type event
| 'replay_event'
// Events with `event_type` csp, hpkp, expectct, expectstaple
| 'security'
// Attachment bytes stored (unused for rate limiting
Expand Down
3 changes: 2 additions & 1 deletion packages/types/src/envelope.ts
Expand Up @@ -26,7 +26,8 @@ export type EnvelopeItemType =
| 'sessions'
| 'transaction'
| 'attachment'
| 'event';
| 'event'
| 'replay_event';

export type BaseEnvelopeHeaders = {
[key: string]: unknown;
Expand Down
1 change: 1 addition & 0 deletions packages/utils/src/envelope.ts
Expand Up @@ -133,6 +133,7 @@ const ITEM_TYPE_TO_DATA_CATEGORY_MAP: Record<EnvelopeItemType, DataCategory> = {
event: 'error',
client_report: 'internal',
user_report: 'default',
replay_event: 'replay_event',
};

/**
Expand Down

0 comments on commit 2a68ccf

Please sign in to comment.