Skip to content

feat: Update Next.js 13.2.0 to v8.0.0-beta.4 #21

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

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
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: 13 additions & 0 deletions apps/nextjs-13_2_0/instrumentation.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import * as Sentry from '@sentry/nextjs';

export function register() {
if (process.env.NEXT_RUNTIME === 'nodejs' || process.env.NEXT_RUNTIME === 'edge') {
Sentry.init({
environment: 'qa', // dynamic sampling bias to keep transactions
dsn: process.env.SENTRY_DSN,
includeLocalVariables: true,
tunnel: `http://localhost:3031/`, // proxy server
tracesSampleRate: 1,
});
}
}
1 change: 1 addition & 0 deletions apps/nextjs-13_2_0/next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ const { withSentryConfig } = require('@sentry/nextjs');
const nextConfig = {
experimental: {
appDir: true,
instrumentationHook: true,
},
};

Expand Down
2 changes: 1 addition & 1 deletion apps/nextjs-13_2_0/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"lint": "next lint"
},
"dependencies": {
"@sentry/nextjs": "7.110.1",
"@sentry/nextjs": "8.0.0-beta.3",
"@types/node": "20.12.7",
"@types/react": "18.2.79",
"@types/react-dom": "18.2.25",
Expand Down
9 changes: 0 additions & 9 deletions apps/nextjs-13_2_0/sentry.edge.config.ts

This file was deleted.

9 changes: 0 additions & 9 deletions apps/nextjs-13_2_0/sentry.server.config.ts

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,16 @@
"event_id": "[[ID1]]",
"sdk": {
"name": "sentry.javascript.nextjs",
"version": "7.110.1"
"version": "8.0.0-beta.3"
},
"sent_at": "[[ISODateString]]",
"trace": {
"environment": "qa",
"public_key": "[[publicKey]]",
"trace_id": "[[ID2]]"
"sample_rate": "1",
"sampled": "true",
"trace_id": "[[ID2]]",
"transaction": "BaseServer.renderToResponse"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so whyyyy is this coming in here? 🤔 we should be filtering these out, at least I thought so... @lforst could you also give this a look?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think Next.js didn't have the next.span_type attributes yet in that version 🤔 We need to find another way of filtering them.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But the transactions are still missing 🤔 Normally, a "transaction" is saved and when an error happens, a "transaction" and "event" file is saved. In this setup the transaction is missing sometimes (see "Files Changed"). In those cases, another file is created that is based on the transaction name (which is BaseServer or similar).

}
},
{
Expand All @@ -27,31 +30,7 @@
{
"category": "console",
"level": "log",
"message": "\u001b[35mevent\u001b[39m - compiled client and server successfully in 255 ms (1321 modules)",
"timestamp": "[[timestamp]]"
},
{
"category": "console",
"level": "log",
"message": "\u001b[36mwait\u001b[39m - compiling /api/test-error/route (client and server)...",
"timestamp": "[[timestamp]]"
},
{
"category": "console",
"level": "log",
"message": "\u001b[35mevent\u001b[39m - compiled successfully in 91 ms (502 modules)",
"timestamp": "[[timestamp]]"
},
{
"category": "console",
"level": "log",
"message": "\u001b[36mwait\u001b[39m - compiling /api/test-param-success/[param]/route (client and server)...",
"timestamp": "[[timestamp]]"
},
{
"category": "console",
"level": "log",
"message": "\u001b[35mevent\u001b[39m - compiled successfully in 108 ms (502 modules)",
"message": "\u001b[35mevent\u001b[39m - compiled successfully in 247 ms (95 modules)",
"timestamp": "[[timestamp]]"
}
],
Expand Down Expand Up @@ -80,26 +59,30 @@
"name": "macOS",
"version": "14.2"
},
"otel": {
"resource": {
"service.name": "node",
"service.namespace": "sentry",
"service.version": "8.0.0-beta.3",
"telemetry.sdk.language": "nodejs",
"telemetry.sdk.name": "opentelemetry",
"telemetry.sdk.version": "1.23.0"
}
},
"runtime": {
"name": "node",
"version": "v20.12.1"
},
"trace": {
"data": {
"http.response.status_code": 200,
"sentry.op": "http.server",
"sentry.origin": "auto.function.nextjs",
"otel.kind": "INTERNAL",
"sentry.origin": "manual",
"sentry.sample_rate": 1,
"sentry.source": "route"
"sentry.source": "custom"
},
"op": "http.server",
"origin": "auto.function.nextjs",
"parent_span_id": "[[ID3]]",
"span_id": "[[ID4]]",
"origin": "manual",
"span_id": "[[ID3]]",
"status": "ok",
"tags": {
"http.status_code": "200"
},
"trace_id": "[[ID2]]"
}
},
Expand All @@ -109,99 +92,106 @@
"ansi-styles": "4.3.0",
"balanced-match": "1.0.2",
"brace-expansion": "2.0.1",
"caniuse-lite": "1.0.30001610",
"caniuse-lite": "1.0.30001612",
"commondir": "1.0.1",
"debug": "4.3.4",
"estree-walker": "2.0.2",
"fs.realpath": "1.0.0",
"function-bind": "1.1.2",
"has-flag": "4.0.0",
"hasown": "2.0.2",
"import-in-the-middle": "1.7.1",
"inflight": "1.0.6",
"inherits": "2.0.4",
"is-core-module": "2.13.1",
"is-reference": "1.2.1",
"js-tokens": "4.0.0",
"localforage": "1.10.0",
"loose-envify": "1.4.0",
"nanoid": "3.3.7",
"magic-string": "0.27.0",
"module-details-from-path": "1.0.3",
"next": "13.2.0",
"once": "1.4.0",
"picocolors": "1.0.0",
"opentelemetry-instrumentation-fetch-node": "1.2.0",
"picomatch": "2.3.1",
"postcss": "8.4.14",
"react": "18.2.0",
"react-dom": "18.2.0",
"require-in-the-middle": "7.3.0",
"resolve": "1.22.8",
"rollup": "2.78.0",
"rollup": "3.29.4",
"scheduler": "0.23.0",
"source-map-js": "1.2.0",
"semver": "7.6.0",
"shimmer": "1.2.1",
"stacktrace-parser": "0.1.10",
"styled-jsx": "5.1.1",
"wrappy": "1.0.2"
"supports-color": "5.5.0",
"wrappy": "1.0.2",
"yallist": "4.0.0"
},
"platform": "node",
"request": {
"cookies": {},
"headers": {
"accept": "*/*",
"accept-encoding": "gzip, deflate, br",
"accept-language": "en-US,en;q=0.5",
"baggage": "sentry-environment=qa,sentry-public_key=3b6c388182fb435097f41d181be2b2ba,sentry-trace_id=1e639b3a12f042eb99339c3baac20ffa",
"cache-control": "no-cache",
"connection": "keep-alive",
"host": "localhost:3030",
"pragma": "no-cache",
"referer": "http://localhost:3030/test-route-handlers",
"sec-fetch-dest": "empty",
"sec-fetch-mode": "cors",
"sec-fetch-site": "same-origin",
"sentry-trace": "1e639b3a12f042eb99339c3baac20ffa-84813d02de47733d",
"user-agent": "[[user-agent]]"
},
"url": "http://localhost:3030"
},
"sdk": {
"integrations": [
"InboundFilters",
"FunctionToString",
"LinkedErrors",
"RequestData",
"Console",
"Undici",
"NodeFetch",
"OnUncaughtException",
"OnUnhandledRejection",
"ContextLines",
"LocalVariables",
"LocalVariablesAsync",
"Context",
"Modules",
"RewriteFrames",
"Express",
"Fastify",
"Graphql",
"Mongo",
"Mongoose",
"Mysql",
"Mysql2",
"Postgres",
"Nest",
"Hapi",
"Koa",
"Connect",
"Http",
"OnUncaughtException"
"DistDirRewriteFrames"
],
"name": "sentry.javascript.nextjs",
"packages": [
{
"name": "npm:@sentry/nextjs",
"version": "7.110.1"
"version": "8.0.0-beta.3"
},
{
"name": "npm:@sentry/node",
"version": "7.110.1"
"version": "8.0.0-beta.3"
}
],
"version": "7.110.1"
"version": "8.0.0-beta.3"
},
"server_name": "D9M3PY4LQ7.local",
"spans": [],
"spans": [
{
"data": {
"otel.kind": "INTERNAL",
"sentry.origin": "manual"
},
"description": "NextNodeServer.findPageComponents",
"origin": "manual",
"parent_span_id": "[[ID3]]",
"span_id": "[[ID4]]",
"start_timestamp": "[[timestamp]]",
"status": "ok",
"timestamp": "[[timestamp]]",
"trace_id": "[[ID2]]"
}
],
"start_timestamp": "[[timestamp]]",
"tags": {
"http.status_code": "200",
"runtime": "node",
"transaction": "GET /api/test-param-success/[param]"
},
"timestamp": "[[timestamp]]",
"transaction": "GET /api/test-param-success/[param]",
"transaction": "BaseServer.renderToResponse",
"transaction_info": {
"source": "route"
"source": "custom"
},
"type": "transaction"
}
Expand Down
Loading