Skip to content

ref(node): Remove vercel flushing code that does nothing #16217

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
May 7, 2025
Merged
Show file tree
Hide file tree
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
13 changes: 0 additions & 13 deletions dev-packages/node-integration-tests/suites/vercel/instrument.mjs

This file was deleted.

13 changes: 0 additions & 13 deletions dev-packages/node-integration-tests/suites/vercel/scenario.mjs

This file was deleted.

53 changes: 0 additions & 53 deletions dev-packages/node-integration-tests/suites/vercel/test.ts

This file was deleted.

This file was deleted.

18 changes: 0 additions & 18 deletions packages/node/src/integrations/http/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import { addOriginToSpan } from '../../utils/addOriginToSpan';
import { getRequestUrl } from '../../utils/getRequestUrl';
import type { SentryHttpInstrumentationOptions } from './SentryHttpInstrumentation';
import { SentryHttpInstrumentation } from './SentryHttpInstrumentation';
import { SentryHttpInstrumentationBeforeOtel } from './SentryHttpInstrumentationBeforeOtel';

const INTEGRATION_NAME = 'Http';

Expand Down Expand Up @@ -117,10 +116,6 @@ interface HttpOptions {
};
}

const instrumentSentryHttpBeforeOtel = generateInstrumentOnce(`${INTEGRATION_NAME}.sentry-before-otel`, () => {
return new SentryHttpInstrumentationBeforeOtel();
});

const instrumentSentryHttp = generateInstrumentOnce<SentryHttpInstrumentationOptions>(
`${INTEGRATION_NAME}.sentry`,
options => {
Expand Down Expand Up @@ -162,19 +157,6 @@ export const httpIntegration = defineIntegration((options: HttpOptions = {}) =>
return {
name: INTEGRATION_NAME,
setupOnce() {
// TODO: get rid of this too
// Below, we instrument the Node.js HTTP API three times. 2 times Sentry-specific, 1 time OTEL specific.
// Due to timing reasons, we sometimes need to apply Sentry instrumentation _before_ we apply the OTEL
// instrumentation (e.g. to flush on serverless platforms), and sometimes we need to apply Sentry instrumentation
// _after_ we apply OTEL instrumentation (e.g. for isolation scope handling and breadcrumbs).

// This is Sentry-specific instrumentation that is applied _before_ any OTEL instrumentation.
if (process.env.VERCEL) {
// Currently this instrumentation only does something when deployed on Vercel, so to save some overhead, we short circuit adding it here only for Vercel.
// If it's functionality is extended in the future, feel free to remove the if statement and this comment.
instrumentSentryHttpBeforeOtel();
}

const instrumentSpans = _shouldInstrumentSpans(options, getClient<NodeClient>()?.getOptions());

// This is Sentry-specific instrumentation for request isolation and breadcrumbs
Expand Down
Loading