Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ref: Tidy up sentry-integration code #481

Merged
merged 1 commit into from
Aug 7, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading