Skip to content

ref(nextjs): Remove unnecessary logic to filter symbolification/sentry spans #11714

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

Merged
merged 1 commit into from
Apr 22, 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
23 changes: 0 additions & 23 deletions packages/nextjs/src/server/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,29 +151,6 @@ export function init(options: NodeOptions): void {
),
);

// TODO(v8): Remove this because we have `suppressTracing`
addEventProcessor(
Object.assign(
(event => {
if (event.type === 'transaction') {
event.spans = event.spans?.filter(span => {
// Filter out spans for Sentry event sends
const httpTargetAttribute: unknown = span.data?.['http.target'];
if (typeof httpTargetAttribute === 'string') {
// TODO: Find a more robust matching logic - We likely want to use the OTEL SDK's `suppressTracing` in our transport, if we end up using it, we can delete this filtering logic here.
return !httpTargetAttribute.includes('sentry_client') && !httpTargetAttribute.includes('sentry_key');
}

return true;
});
}

return event;
}) satisfies EventProcessor,
{ id: 'NextFilterSentrySpans' },
),
);

if (process.env.NODE_ENV === 'development') {
addEventProcessor(devErrorSymbolicationEventProcessor);
}
Expand Down