Skip to content

Commit 38ac85a

Browse files
authored
feat(core): Add processing metadata to scope and event (#4252)
There are various situations where it's helpful to be able to provide data to the event processing pipeline, without that data necessarily being sent to Sentry. Rather than piggyback that data in `debug_meta`, and then have to do a "is there still anything in it, or should I delete it" dance after that data is pulled back out, it would simpler if we just had a spot where we could chuck anything we wanted with the knowledge that all of the data there will get filtered out of the final event. This introduces such a spot, called `sdkProcessingMetadata`, both on the scope (so that the data can get set at any point prior to the event getting captured) and in the event. No use is (yet) made of this - that will come in future PRs. Note: While there is a public setter for this data on the scope, I'm thinking of this as an internal API, and therefore am not planning to document it for users.
1 parent e5ede4c commit 38ac85a

File tree

6 files changed

+338
-110
lines changed

6 files changed

+338
-110
lines changed

packages/core/src/request.ts

+3
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,9 @@ export function eventToSentryRequest(event: Event, api: APIDetails): SentryReque
6363
event.debug_meta = metadata;
6464
}
6565

66+
// prevent this data from being sent to sentry
67+
delete event.sdkProcessingMetadata;
68+
6669
const req: SentryRequest = {
6770
body: JSON.stringify(sdkInfo ? enhanceEventWithSdkInfo(event, api.metadata.sdk) : event),
6871
type: eventType,

0 commit comments

Comments
 (0)