Skip to content

Commit 9cc3129

Browse files
committed
start ID with 1
1 parent 68be2d5 commit 9cc3129

File tree

6 files changed

+288
-47
lines changed

6 files changed

+288
-47
lines changed

utils/event-proxy-server/payload-files/express/test-error.json

Lines changed: 270 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[
22
{
3-
"event_id": "[[ID12]]",
3+
"event_id": "[[ID1]]",
44
"sent_at": "[[ISODateString]]",
55
"sdk": {
66
"name": "sentry.javascript.node",
@@ -10,34 +10,286 @@
1010
"trace": {
1111
"environment": "qa",
1212
"public_key": "[[publicKey]]",
13-
"trace_id": "[[ID10]]",
13+
"trace_id": "[[ID2]]",
1414
"sample_rate": "1",
1515
"transaction": "GET /test-error",
1616
"sampled": "true"
1717
}
1818
},
1919
{
20-
"type": "transaction"
20+
"type": "event"
2121
},
2222
{
23+
"exception": {
24+
"values": [
25+
{
26+
"type": "Error",
27+
"value": "This is an error",
28+
"stacktrace": {
29+
"frames": [
30+
{
31+
"filename": "/Users/sigridh/Documents/DEV/sentry-javascript-examples/node_modules/express/lib/router/route.js",
32+
"module": "express.lib.router:route",
33+
"function": "Route.dispatch",
34+
"lineno": 119,
35+
"colno": 3,
36+
"in_app": false,
37+
"pre_context": [
38+
"",
39+
" if (method === 'head' && !this.methods['head']) {",
40+
" method = 'get';",
41+
" }",
42+
"",
43+
" req.route = this;",
44+
""
45+
],
46+
"context_line": " next();",
47+
"post_context": [
48+
"",
49+
" function next(err) {",
50+
" // signal to exit route",
51+
" if (err && err === 'route') {",
52+
" return done();",
53+
" }",
54+
""
55+
]
56+
},
57+
{
58+
"filename": "/Users/sigridh/Documents/DEV/sentry-javascript-examples/node_modules/express/lib/router/route.js",
59+
"module": "express.lib.router:route",
60+
"function": "next",
61+
"lineno": 149,
62+
"colno": 13,
63+
"in_app": false,
64+
"pre_context": [
65+
" }",
66+
"",
67+
" if (layer.method && layer.method !== method) {",
68+
" next(err)",
69+
" } else if (err) {",
70+
" layer.handle_error(err, req, res, next);",
71+
" } else {"
72+
],
73+
"context_line": " layer.handle_request(req, res, next);",
74+
"post_context": [" }", "", " sync = 0", " }", "};", "", "/**"]
75+
},
76+
{
77+
"filename": "/Users/sigridh/Documents/DEV/sentry-javascript-examples/node_modules/express/lib/router/layer.js",
78+
"module": "express.lib.router:layer",
79+
"function": "Layer.handle [as handle_request]",
80+
"lineno": 95,
81+
"colno": 5,
82+
"in_app": false,
83+
"pre_context": [
84+
"",
85+
" if (fn.length > 3) {",
86+
" // not a standard request handler",
87+
" return next();",
88+
" }",
89+
"",
90+
" try {"
91+
],
92+
"context_line": " fn(req, res, next);",
93+
"post_context": [
94+
" } catch (err) {",
95+
" next(err);",
96+
" }",
97+
"};",
98+
"",
99+
"/**",
100+
" * Check if this route matches `path`, if so"
101+
]
102+
},
103+
{
104+
"filename": "/Users/sigridh/Documents/DEV/sentry-javascript-examples/apps/express/dist/app.js",
105+
"module": "app",
106+
"function": "<anonymous>",
107+
"lineno": 105,
108+
"colno": 12,
109+
"in_app": true,
110+
"pre_context": [
111+
" });",
112+
" return [2 /*return*/];",
113+
" }",
114+
" });",
115+
" });",
116+
"});",
117+
"app.get('/test-error', function (req, res) {"
118+
],
119+
"context_line": " return __awaiter(this, void 0, void 0, function () {",
120+
"post_context": [
121+
" var exceptionId;",
122+
" return __generator(this, function (_a) {",
123+
" switch (_a.label) {",
124+
" case 0:",
125+
" exceptionId = Sentry.captureException(new Error('This is an error'));",
126+
" return [4 /*yield*/, Sentry.flush(2000)];",
127+
" case 1:"
128+
]
129+
},
130+
{
131+
"filename": "/Users/sigridh/Documents/DEV/sentry-javascript-examples/apps/express/dist/app.js",
132+
"module": "app",
133+
"function": "__awaiter",
134+
"lineno": 27,
135+
"colno": 12,
136+
"in_app": true,
137+
"pre_context": [
138+
" var result = {};",
139+
" if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);",
140+
" __setModuleDefault(result, mod);",
141+
" return result;",
142+
"};",
143+
"var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {",
144+
" function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }"
145+
],
146+
"context_line": " return new (P || (P = Promise))(function (resolve, reject) {",
147+
"post_context": [
148+
" function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }",
149+
" function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }",
150+
" function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }",
151+
" step((generator = generator.apply(thisArg, _arguments || [])).next());",
152+
" });",
153+
"};",
154+
"var __generator = (this && this.__generator) || function (thisArg, body) {"
155+
]
156+
},
157+
{
158+
"filename": "<anonymous>",
159+
"module": "<anonymous>",
160+
"function": "new Promise",
161+
"in_app": false
162+
},
163+
{
164+
"filename": "/Users/sigridh/Documents/DEV/sentry-javascript-examples/apps/express/dist/app.js",
165+
"module": "app",
166+
"function": "<anonymous>",
167+
"lineno": 31,
168+
"colno": 71,
169+
"in_app": true,
170+
"pre_context": [
171+
"};",
172+
"var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {",
173+
" function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }",
174+
" return new (P || (P = Promise))(function (resolve, reject) {",
175+
" function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }",
176+
" function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }",
177+
" function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }"
178+
],
179+
"context_line": " step((generator = generator.apply(thisArg, _arguments || [])).next());",
180+
"post_context": [
181+
" });",
182+
"};",
183+
"var __generator = (this && this.__generator) || function (thisArg, body) {",
184+
" var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;",
185+
" return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { re {snip}",
186+
" function verb(n) { return function (v) { return step([n, v]); }; }",
187+
" function step(op) {"
188+
]
189+
},
190+
{
191+
"filename": "/Users/sigridh/Documents/DEV/sentry-javascript-examples/apps/express/dist/app.js",
192+
"module": "app",
193+
"function": "Object.next",
194+
"lineno": 37,
195+
"colno": 53,
196+
"in_app": true,
197+
"pre_context": [
198+
" function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }",
199+
" step((generator = generator.apply(thisArg, _arguments || [])).next());",
200+
" });",
201+
"};",
202+
"var __generator = (this && this.__generator) || function (thisArg, body) {",
203+
" var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;",
204+
" return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { re {snip}"
205+
],
206+
"context_line": " function verb(n) { return function (v) { return step([n, v]); }; }",
207+
"post_context": [
208+
" function step(op) {",
209+
" if (f) throw new TypeError(\"Generator is already executing.\");",
210+
" while (g && (g = 0, op[0] && (_ = 0)), _) try {",
211+
" if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.ca {snip}",
212+
" if (y = 0, t) op = [op[0] & 2, t.value];",
213+
" switch (op[0]) {",
214+
" case 0: case 1: t = op; break;"
215+
]
216+
},
217+
{
218+
"filename": "/Users/sigridh/Documents/DEV/sentry-javascript-examples/apps/express/dist/app.js",
219+
"module": "app",
220+
"function": "step",
221+
"lineno": 56,
222+
"colno": 23,
223+
"in_app": true,
224+
"pre_context": [
225+
" if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }",
226+
" if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }",
227+
" if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }",
228+
" if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }",
229+
" if (t[2]) _.ops.pop();",
230+
" _.trys.pop(); continue;",
231+
" }"
232+
],
233+
"context_line": " op = body.call(thisArg, _);",
234+
"post_context": [
235+
" } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }",
236+
" if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };",
237+
" }",
238+
"};",
239+
"var __importDefault = (this && this.__importDefault) || function (mod) {",
240+
" return (mod && mod.__esModule) ? mod : { \"default\": mod };",
241+
"};"
242+
]
243+
},
244+
{
245+
"filename": "/Users/sigridh/Documents/DEV/sentry-javascript-examples/apps/express/dist/app.js",
246+
"module": "app",
247+
"function": "<anonymous>",
248+
"lineno": 110,
249+
"colno": 59,
250+
"in_app": true,
251+
"pre_context": [
252+
"});",
253+
"app.get('/test-error', function (req, res) {",
254+
" return __awaiter(this, void 0, void 0, function () {",
255+
" var exceptionId;",
256+
" return __generator(this, function (_a) {",
257+
" switch (_a.label) {",
258+
" case 0:"
259+
],
260+
"context_line": " exceptionId = Sentry.captureException(new Error('This is an error'));",
261+
"post_context": [
262+
" return [4 /*yield*/, Sentry.flush(2000)];",
263+
" case 1:",
264+
" _a.sent();",
265+
" res.send({ exceptionId: exceptionId });",
266+
" return [2 /*return*/];",
267+
" }",
268+
" });"
269+
]
270+
}
271+
]
272+
},
273+
"mechanism": {
274+
"type": "generic",
275+
"handled": true
276+
}
277+
}
278+
]
279+
},
280+
"event_id": "[[ID1]]",
281+
"platform": "node",
23282
"contexts": {
24283
"trace": {
25284
"data": {
26285
"sentry.source": "url",
27-
"query": {},
28-
"http.response.status_code": 200,
29286
"sentry.origin": "auto.http.node.tracingHandler",
30287
"sentry.op": "http.server",
31-
"sentry.sample_rate": 1,
32-
"url": "/test-error"
288+
"sentry.sample_rate": 1
33289
},
34290
"op": "http.server",
35-
"span_id": "[[ID11]]",
36-
"status": "ok",
37-
"tags": {
38-
"http.status_code": "200"
39-
},
40-
"trace_id": "[[ID10]]",
291+
"span_id": "[[ID1]]",
292+
"trace_id": "[[ID2]]",
41293
"origin": "auto.http.node.tracingHandler"
42294
},
43295
"runtime": {
@@ -69,20 +321,8 @@
69321
},
70322
"cloud_resource": {}
71323
},
72-
"spans": [],
73-
"start_timestamp": "[[timestamp]]",
74-
"tags": {
75-
"http.status_code": "200"
76-
},
77-
"timestamp": "[[timestamp]]",
78-
"transaction": "GET /test-error",
79-
"type": "transaction",
80-
"transaction_info": {
81-
"source": "custom"
82-
},
83-
"platform": "node",
84324
"server_name": "D9M3PY4LQ7.local",
85-
"event_id": "[[ID12]]",
325+
"timestamp": "[[timestamp]]",
86326
"environment": "qa",
87327
"sdk": {
88328
"integrations": [
@@ -109,6 +349,9 @@
109349
}
110350
]
111351
},
352+
"tags": {
353+
"transaction": "GET /test-error"
354+
},
112355
"breadcrumbs": [
113356
{
114357
"timestamp": "[[timestamp]]",
@@ -137,6 +380,7 @@
137380
"query_string": {},
138381
"url": "http://localhost:3030/test-error"
139382
},
383+
"transaction": "GET /test-error",
140384
"modules": {
141385
"express": "4.19.2",
142386
"body-parser": "1.20.2",

utils/event-proxy-server/payload-files/express/test-local-variables-uncaught.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
"url": "/test-local-variables-uncaught"
3333
},
3434
"op": "http.server",
35-
"span_id": "[[ID3]]",
35+
"span_id": "[[ID1]]",
3636
"status": "internal_error",
3737
"tags": {
3838
"http.status_code": "500"

utils/event-proxy-server/payload-files/express/test-param_3.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
"url": "/test-param/3"
3333
},
3434
"op": "http.server",
35-
"span_id": "[[ID3]]",
35+
"span_id": "[[ID1]]",
3636
"status": "ok",
3737
"tags": {
3838
"http.status_code": "200"

utils/event-proxy-server/payload-files/express/test-success.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
"url": "/test-success"
3333
},
3434
"op": "http.server",
35-
"span_id": "[[ID3]]",
35+
"span_id": "[[ID1]]",
3636
"status": "ok",
3737
"tags": {
3838
"http.status_code": "200"

0 commit comments

Comments
 (0)