Skip to content
Closed
Show file tree
Hide file tree
Changes from 3 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
2 changes: 1 addition & 1 deletion apps/express/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"extends": "../../package.json"
},
"dependencies": {
"@sentry/node": "^7.109.0",
"@sentry/node": "^8.0.0-alpha.9",
"express": "^4.19.2"
},
"devDependencies": {
Expand Down
26 changes: 12 additions & 14 deletions apps/express/src/app.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,15 @@
import * as Sentry from '@sentry/node';

Sentry.init({
environment: 'qa', // dynamic sampling bias to keep transactions
dsn: process.env.E2E_TEST_DSN,
includeLocalVariables: true,
debug: true,
tunnel: `http://localhost:3031/`, // proxy server
tracesSampleRate: 1,
});

// can use `import` instead of `require` because of `'esModuleInterop': true` in tsconfig.json
import express from 'express';

declare global {
Expand All @@ -10,19 +21,6 @@ declare global {
const app = express();
const port = 3030;

Sentry.init({
environment: 'qa', // dynamic sampling bias to keep transactions
dsn: process.env.E2E_TEST_DSN,
includeLocalVariables: true,
debug: true,
tunnel: `http://127.0.0.1:3031/`, // proxy server
tracesSampleRate: 1,
integrations: [new Sentry.Integrations.Express({ app })],
});

app.use(Sentry.Handlers.requestHandler());
app.use(Sentry.Handlers.tracingHandler());

app.get('/test-success', function (req, res) {
res.send({ version: 'v1' });
});
Expand Down Expand Up @@ -91,7 +89,7 @@ app.get('/test-local-variables-caught', function (req, res) {
res.send({ exceptionId, randomVariableToRecord });
});

app.use(Sentry.Handlers.errorHandler());
Sentry.setupExpressErrorHandler(app);

// @ts-ignore
app.use(function onError(err, req, res, next) {
Expand Down
4 changes: 2 additions & 2 deletions utils/event-proxy-server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
"clean": "rimraf -g ./node_modules ./build"
},
"dependencies": {
"@sentry/types": "7.109.0",
"@sentry/utils": "7.109.0"
"@sentry/types": "8.0.0-alpha.9",
"@sentry/utils": "8.0.0-alpha.9"
},
"volta": {
"extends": "../../package.json"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,9 @@
"sent_at": "[[ISODateString]]",
"sdk": {
"name": "sentry.javascript.node",
"version": "7.109.0"
"version": "8.0.0-alpha.9"
},
"dsn": "[[dsn]]",
"trace": {
Copy link
Member

Choose a reason for hiding this comment

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

this seems bad :O that should all be here 🤔

"environment": "qa",
"public_key": "[[publicKey]]",
"trace_id": "[[ID2]]",
"sample_rate": "1",
"transaction": "GET /test-error",
"sampled": "true"
}
"dsn": "[[dsn]]"
},
{
"type": "event"
Expand Down Expand Up @@ -111,14 +103,14 @@
{
"filename": "[[FILENAME3]]",
"module": "app",
"function": "<anonymous>",
"lineno": 85,
"function": "?",
"lineno": 83,
"colno": 12,
"in_app": true,
"pre_context": [
"var app = (0, express_1.default)();",
"var port = 3030;",
"// todo: add express integration to docs",
"app.use(Sentry.Handlers.requestHandler());",
"app.use(Sentry.Handlers.tracingHandler());",
"app.get('/test-success', function (req, res) {",
" res.send({ version: 'v1' });",
"});",
Expand Down Expand Up @@ -171,7 +163,7 @@
{
"filename": "[[FILENAME3]]",
"module": "app",
"function": "<anonymous>",
"function": "?",
"lineno": 31,
"colno": 71,
"in_app": true,
Expand Down Expand Up @@ -252,8 +244,8 @@
{
"filename": "[[FILENAME3]]",
"module": "app",
"function": "<anonymous>",
"lineno": 90,
"function": "?",
"lineno": 88,
"colno": 59,
"in_app": true,
"pre_context": [
Expand Down Expand Up @@ -289,16 +281,8 @@
"platform": "node",
"contexts": {
"trace": {
"data": {
"sentry.source": "route",
"sentry.origin": "auto.http.node.tracingHandler",
"sentry.op": "http.server",
"sentry.sample_rate": 1
},
"op": "http.server",
"span_id": "[[ID3]]",
"trace_id": "[[ID2]]",
"origin": "auto.http.node.tracingHandler"
"span_id": "[[ID3]]"
},
"runtime": {
"name": "node",
Expand Down Expand Up @@ -340,27 +324,34 @@
"RequestData",
"Console",
"Http",
"Undici",
"NodeFetch",
"OnUncaughtException",
"OnUnhandledRejection",
"ContextLines",
"LocalVariables",
"Context",
"Modules",
"Express"
"Express",
"Fastify",
"Graphql",
"Mongo",
"Mongoose",
"Mysql",
"Mysql2",
"Postgres",
"Nest",
"Hapi",
"Koa"
],
"name": "sentry.javascript.node",
"version": "7.109.0",
"version": "8.0.0-alpha.9",
"packages": [
{
"name": "npm:@sentry/node",
"version": "7.109.0"
"version": "8.0.0-alpha.9"
}
]
},
"tags": {
"transaction": "GET /test-error"
},
"breadcrumbs": [
{
"timestamp": "[[timestamp]]",
Expand All @@ -384,14 +375,24 @@
"sec-fetch-mode": "navigate",
"sec-fetch-site": "none",
"sec-fetch-user": "?1",
"pragma": "no-cache",
"cache-control": "no-cache"
"if-none-match": "[[W/entityTagValue]]"
},
"query_string": {},
"url": "http://localhost:3030/test-error"
},
"transaction": "GET /test-error",
"modules": {
"semver": "7.6.0",
"yallist": "4.0.0",
"shimmer": "1.2.1",
"require-in-the-middle": "7.3.0",
"resolve": "1.22.8",
"is-core-module": "2.13.1",
"hasown": "2.0.2",
"function-bind": "1.1.2",
"debug": "4.3.4",
"supports-color": "5.5.0",
"module-details-from-path": "1.0.3",
"import-in-the-middle": "1.7.3",
"express": "4.19.2",
"body-parser": "1.20.2",
"depd": "2.0.0",
Expand All @@ -415,8 +416,6 @@
"es-errors": "1.3.0",
"has-symbols": "1.0.3",
"has-proto": "1.0.3",
"function-bind": "1.1.2",
"hasown": "2.0.2",
"call-bind": "1.0.7",
"set-function-length": "1.2.2",
"define-data-property": "1.1.4",
Expand Down Expand Up @@ -453,7 +452,8 @@
"raw-body": "2.5.2",
"iconv-lite": "0.4.24",
"safer-buffer": "2.1.2",
"serve-static": "1.15.0"
"serve-static": "1.15.0",
"opentelemetry-instrumentation-fetch-node": "1.1.2"
}
}
]
Loading