Skip to content

feat(nextjs): Remove runtime and vercel tags #11291

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 39 commits into from
Mar 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
3b5d9ce
feat(nextjs): Use OpenTelemetry for performance monitoring
Mar 21, 2024
c5146f3
revert accidental change
Mar 21, 2024
5d1e52a
Update E2E test to check for Next.js fetch
Mar 21, 2024
93bf4f9
Fix integration tests
Mar 21, 2024
e3ead78
Increase nock count timeout
Mar 21, 2024
6a5e564
unflake tests
Mar 21, 2024
cf5fe92
maybe?
Mar 21, 2024
15ffe0f
Merge remote-tracking branch 'origin/develop' into lforst-nextjs-otel
Mar 22, 2024
d4b0e65
Update dev dependencies in e2e test
Mar 22, 2024
0973ee0
logs
Mar 22, 2024
e4aecd0
Merge remote-tracking branch 'origin/develop' into lforst-nextjs-otel
Mar 22, 2024
201d459
Print build errors
Mar 25, 2024
c4c37fd
Merge remote-tracking branch 'origin/develop' into lforst-nextjs-otel
Mar 25, 2024
55c3bc7
whoops
Mar 25, 2024
c16a2d9
Update replay dev dep
Mar 25, 2024
d11620e
Build errors
Mar 25, 2024
7e7824c
filter static assets
s1gr1d Mar 25, 2024
728c086
Increase buffer size
Mar 25, 2024
b61b646
Merge remote-tracking branch 'origin/develop' into lforst-nextjs-otel
Mar 25, 2024
684dd65
Wait for res close in tests
Mar 25, 2024
dc0fe4f
fix consuming data
Mar 25, 2024
d39e169
Losing my mind again
Mar 25, 2024
57c7026
Move test to e2e
Mar 26, 2024
8ae8d8d
Rename
Mar 26, 2024
ac79853
Work aroud Node 20 bug
Mar 26, 2024
f297b78
Merge remote-tracking branch 'origin/develop' into lforst-nextjs-otel
Mar 26, 2024
3aaeb06
Add back dev test
Mar 26, 2024
785f36d
Add comment about build assertion
Mar 26, 2024
caa9fb0
Clean up devDeps resolutions in e2e test
Mar 26, 2024
ba3f500
Undo node integration test timeout
Mar 26, 2024
4e6097c
Refactor new filtering logic
Mar 26, 2024
47f3b1b
Fix types
Mar 26, 2024
65f3e73
Try to unflake
Mar 26, 2024
348a656
add timeout - last resort
Mar 26, 2024
0eb8af0
Add exports
Mar 26, 2024
058ef92
feat(nextjs): Remove `runtime` and `vercel` tags
Mar 26, 2024
2b7ab08
Merge remote-tracking branch 'origin/develop' into lforst-rm-deprecat…
Mar 27, 2024
d777b23
tests
Mar 27, 2024
f4f730c
.
Mar 27, 2024
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
10 changes: 1 addition & 9 deletions packages/nextjs/src/server/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { addEventProcessor, addTracingExtensions, applySdkMetadata, getClient, setTag } from '@sentry/core';
import { addEventProcessor, addTracingExtensions, applySdkMetadata, getClient } from '@sentry/core';
import { getDefaultIntegrations, init as nodeInit } from '@sentry/node';
import type { NodeOptions } from '@sentry/node';
import { GLOBAL_OBJ, logger } from '@sentry/utils';
Expand Down Expand Up @@ -63,8 +63,6 @@ export function showReportDialog(): void {
return;
}

const IS_VERCEL = !!process.env.VERCEL;

/** Inits the Sentry NextJS SDK on node. */
export function init(options: NodeOptions): void {
addTracingExtensions();
Expand Down Expand Up @@ -173,12 +171,6 @@ export function init(options: NodeOptions): void {
),
);

// TODO(v8): Remove these tags
setTag('runtime', 'node');
if (IS_VERCEL) {
setTag('vercel', true);
}

if (process.env.NODE_ENV === 'development') {
addEventProcessor(devErrorSymbolicationEventProcessor);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@ describe('Error API Endpoints', () => {
},
],
},
tags: {
runtime: 'node',
},
request: {
url,
method: 'GET',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@ describe('Error Server-side Props', () => {
},
],
},
tags: {
runtime: 'node',
},
request: {
url,
method: 'GET',
Expand Down
8 changes: 0 additions & 8 deletions packages/nextjs/test/serverSdk.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,6 @@ describe('Server init()', () => {
expect(nodeInit).toHaveBeenCalledTimes(1);
});

it('sets runtime on scope', () => {
expect(SentryNode.getIsolationScope().getScopeData().tags).toEqual({});

init({ dsn: 'https://[email protected]/1337' });

expect(SentryNode.getIsolationScope().getScopeData().tags).toEqual({ runtime: 'node' });
});

// TODO: test `vercel` tag when running on Vercel
// Can't just add the test and set env variables, since the value in `index.server.ts`
// is resolved when importing.
Expand Down