MCPcopy Index your code
hub / github.com/getsentry/sentry-javascript / recordDroppedEvent

Function recordDroppedEvent

packages/core/src/client.ts:608–620  ·  view source on GitHub ↗

* Record on the client that an event got dropped (ie, an event that will not be sent to Sentry).

(reason: EventDropReason, category: DataCategory, count: number = 1)

Source from the content-addressed store, hash-verified

606 * Record on the client that an event got dropped (ie, an event that will not be sent to Sentry).
607 */
608 public recordDroppedEvent(reason: EventDropReason, category: DataCategory, count: number = 1): void {
609 if (this._options.sendClientReports) {
610 // We want to track each category (error, transaction, session, replay_event) separately
611 // but still keep the distinction between different type of outcomes.
612 // We could use nested maps, but it's much easier to read and type this way.
613 // A correct type for map-based implementation if we want to go that route
614 // would be `Partial<Record<SentryRequestType, Partial<Record<Outcome, number>>>>`
615 // With typescript 4.1 we could even use template literal types
616 const key = `${reason}:${category}`;
617 DEBUG_BUILD && debug.log(`Recording outcome: "${key}"${count > 1 ? ` (${count} times)` : ''}`);
618 this._outcomes[key] = (this._outcomes[key] || 0) + count;
619 }
620 }
621
622 /* eslint-disable @typescript-eslint/unified-signatures */
623 /**

Callers

nothing calls this directly

Calls 1

logMethod · 0.65

Tested by

no test coverage detected