Skip to content

Commit

Permalink
ref: Tidy up sentry-integration code (#481)
Browse files Browse the repository at this point in the history
  • Loading branch information
BYK authored Aug 7, 2024
1 parent 2c67247 commit 16704fe
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions packages/overlay/src/integrations/sentry/sentry-integration.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Client, Envelope, Event, Integration } from '@sentry/types';
import type { Client, Envelope, Event, Integration } from '@sentry/types';
import { serializeEnvelope } from '@sentry/utils';
import { DEFAULT_SIDECAR_URL } from '~/constants';
import { log } from '../../lib/logger';
Expand All @@ -17,10 +17,8 @@ type SpotlightBrowserIntegrationOptions = {

/**
* A Sentry integration for Spotlight integration that the Overlay will inject automatically.
* This integration does a couple of things:
* This integration does the following:
*
* - Try to enrich stack traces by querying a potentially existing context lines integration
* on the server side (@see packages/astro/src/vite/source-context.ts)
* - Drop transactions created from interactions with the Spotlight UI
* - Forward Sentry events sent from the browser SDK to the Sidecar instance running on
* either on http://localhost:8969/stream or on the supplied `sidecarUrl` option.
Expand All @@ -40,7 +38,7 @@ export const spotlightIntegration = (options?: SpotlightBrowserIntegrationOption
setup: () => {
log('Using Sidecar URL', _sidecarUrl);
},
processEvent: async (event: Event) => {
processEvent: (event: Event) => {
// We don't want to send interaction transactions/root spans created from
// clicks within Spotlight to Sentry. Neither do we want them to be sent to
// spotlight.
Expand All @@ -53,10 +51,6 @@ export const spotlightIntegration = (options?: SpotlightBrowserIntegrationOption
sentryDataCache.trackLocalTrace(traceId);
}

if (event.type || !event.exception || !event.exception.values) {
return event;
}

return event;
},
afterAllSetup: (client: Client) => {
Expand Down

0 comments on commit 16704fe

Please sign in to comment.