|
4 | 4 | "event_id": "[[ID1]]",
|
5 | 5 | "sdk": {
|
6 | 6 | "name": "sentry.javascript.node",
|
7 |
| - "version": "8.0.0-beta.6" |
| 7 | + "version": "8.0.0-rc.1" |
8 | 8 | },
|
9 | 9 | "sent_at": "[[ISODateString]]",
|
10 | 10 | "trace": {
|
|
58 | 58 | "version": "v20.12.1"
|
59 | 59 | },
|
60 | 60 | "trace": {
|
61 |
| - "span_id": "[[ID3]]", |
| 61 | + "parent_span_id": "[[ID3]]", |
| 62 | + "span_id": "[[ID4]]", |
62 | 63 | "trace_id": "[[ID2]]"
|
63 | 64 | }
|
64 | 65 | },
|
|
74 | 75 | "stacktrace": {
|
75 | 76 | "frames": [
|
76 | 77 | {
|
77 |
| - "colno": 36, |
78 |
| - "context_line": " const result = await internals.handler(request, request.route.settings.handler);", |
| 78 | + "colno": 40, |
| 79 | + "context_line": " return this._asyncLocalStorage.run(context, cb, ...args);", |
79 | 80 | "filename": "[[FILENAME1]]",
|
80 |
| - "function": "exports.execute", |
| 81 | + "function": "SentryContextManager.with", |
81 | 82 | "in_app": false,
|
82 |
| - "lineno": 31, |
83 |
| - "module": "@hapi.hapi.lib:handler", |
| 83 | + "lineno": 33, |
| 84 | + "module": "@opentelemetry.context-async-hooks.build.src:AsyncLocalStorageContextManager", |
84 | 85 | "post_context": [
|
85 |
| - " if (result._takeover ||", |
86 |
| - " typeof result === 'symbol') {", |
87 |
| - "", |
88 |
| - " return result;", |
89 | 86 | " }",
|
90 |
| - "", |
91 |
| - " request._setResponse(result);" |
| 87 | + " enable() {", |
| 88 | + " return this;", |
| 89 | + " }", |
| 90 | + " disable() {", |
| 91 | + " this._asyncLocalStorage.disable();", |
| 92 | + " return this;" |
92 | 93 | ],
|
93 | 94 | "pre_context": [
|
94 |
| - " }", |
95 |
| - " }", |
96 |
| - " }", |
97 | 95 | " }",
|
98 |
| - "", |
99 |
| - " // Handler", |
100 |
| - "" |
| 96 | + " active() {", |
| 97 | + " var _a;", |
| 98 | + " return (_a = this._asyncLocalStorage.getStore()) !== null && _a !== void 0 ? _a : api_1.ROOT_CONTEXT;", |
| 99 | + " }", |
| 100 | + " with(context, fn, thisArg, ...args) {", |
| 101 | + " const cb = thisArg == null ? fn : fn.bind(thisArg);" |
101 | 102 | ]
|
102 | 103 | },
|
103 | 104 | {
|
104 |
| - "colno": 48, |
105 |
| - "context_line": " let response = await request._core.toolkit.execute(method, request, { bind, realm, continue: 'null' });", |
106 |
| - "filename": "[[FILENAME1]]", |
107 |
| - "function": "internals.handler", |
| 105 | + "colno": 14, |
| 106 | + "filename": "[[FILENAME2]]", |
| 107 | + "function": "AsyncLocalStorage.run", |
108 | 108 | "in_app": false,
|
109 |
| - "lineno": 46, |
110 |
| - "module": "@hapi.hapi.lib:handler", |
111 |
| - "post_context": [ |
112 |
| - "", |
113 |
| - " // Handler", |
114 |
| - "", |
115 |
| - " if (!pre) {", |
116 |
| - " if (response.isBoom) {", |
117 |
| - " request._log(['handler', 'error'], response);", |
118 |
| - " throw response;" |
119 |
| - ], |
120 |
| - "pre_context": [ |
121 |
| - "};", |
122 |
| - "", |
123 |
| - "", |
124 |
| - "internals.handler = async function (request, method, pre) {", |
125 |
| - "", |
126 |
| - " const bind = request.route.settings.bind;", |
127 |
| - " const realm = request.route.realm;" |
128 |
| - ] |
| 109 | + "lineno": 346, |
| 110 | + "module": "node:async_hooks" |
129 | 111 | },
|
130 | 112 | {
|
131 |
| - "colno": 29, |
132 |
| - "context_line": " operation = method(request, h);", |
133 |
| - "filename": "[[FILENAME2]]", |
134 |
| - "function": "exports.Manager.execute", |
| 113 | + "colno": 115, |
| 114 | + "context_line": " return await api.context.with(api.trace.setSpan(api.context.active(), span), () => oldHandler.call(this, ...params));", |
| 115 | + "filename": "[[FILENAME3]]", |
| 116 | + "function": "?", |
135 | 117 | "in_app": false,
|
136 |
| - "lineno": 57, |
137 |
| - "module": "@hapi.hapi.lib:toolkit", |
| 118 | + "lineno": 266, |
| 119 | + "module": "@opentelemetry.instrumentation-hapi.build.src:instrumentation", |
138 | 120 | "post_context": [
|
139 |
| - " }", |
140 |
| - "", |
141 |
| - " var response = await exports.timed(operation, options);", |
142 |
| - " }", |
143 |
| - " catch (err) {", |
144 |
| - " if (Bounce.isSystem(err)) {", |
145 |
| - " response = Boom.badImplementation(err);" |
| 121 | + " }", |
| 122 | + " catch (err) {", |
| 123 | + " span.recordException(err);", |
| 124 | + " span.setStatus({", |
| 125 | + " code: api.SpanStatusCode.ERROR,", |
| 126 | + " message: err.message,", |
| 127 | + " });" |
146 | 128 | ],
|
147 | 129 | "pre_context": [
|
148 |
| - " if (bind) {", |
149 |
| - " operation = method.call(bind, request, h);", |
150 |
| - " }", |
151 |
| - " else if (options.args) {", |
152 |
| - " operation = method(request, h, ...options.args);", |
153 |
| - " }", |
154 |
| - " else {" |
| 130 | + " rpcMetadata.route = route.path;", |
| 131 | + " }", |
| 132 | + " const metadata = (0, utils_1.getRouteMetadata)(route, pluginName);", |
| 133 | + " const span = instrumentation.tracer.startSpan(metadata.name, {", |
| 134 | + " attributes: metadata.attributes,", |
| 135 | + " });", |
| 136 | + " try {" |
155 | 137 | ]
|
156 | 138 | },
|
157 | 139 | {
|
158 |
| - "colno": 24, |
159 |
| - "context_line": " return __awaiter(this, void 0, void 0, function () {", |
160 |
| - "filename": "[[FILENAME3]]", |
| 140 | + "colno": 32, |
| 141 | + "context_line": " return __awaiter(this, void 0, void 0, function () {", |
| 142 | + "filename": "[[FILENAME4]]", |
161 | 143 | "function": "handler",
|
162 | 144 | "in_app": true,
|
163 |
| - "lineno": 72, |
| 145 | + "lineno": 98, |
164 | 146 | "module": "app",
|
165 | 147 | "post_context": [
|
166 |
| - " var exceptionId;", |
167 |
| - " return __generator(this, function (_a) {", |
168 |
| - " switch (_a.label) {", |
169 |
| - " case 0:", |
170 |
| - " exceptionId = Sentry.captureException(new Error('This is an error'));", |
171 |
| - " return [4 /*yield*/, Sentry.flush(2000)];", |
172 |
| - " case 1:" |
| 148 | + " var exceptionId;", |
| 149 | + " return __generator(this, function (_a) {", |
| 150 | + " switch (_a.label) {", |
| 151 | + " case 0:", |
| 152 | + " exceptionId = Sentry.captureException(new Error('This is an error'));", |
| 153 | + " return [4 /*yield*/, Sentry.flush(2000)];", |
| 154 | + " case 1:" |
173 | 155 | ],
|
174 | 156 | "pre_context": [
|
175 |
| - " return { version: 'v1' };", |
176 |
| - " },", |
177 |
| - " });", |
178 |
| - " server.route({", |
179 |
| - " method: 'GET',", |
180 |
| - " path: '/test-error',", |
181 |
| - " handler: function (request, h) {" |
| 157 | + " return { version: 'v1' };", |
| 158 | + " },", |
| 159 | + " });", |
| 160 | + " server.route({", |
| 161 | + " method: 'GET',", |
| 162 | + " path: '/test-error',", |
| 163 | + " handler: function (request, h) {" |
182 | 164 | ]
|
183 | 165 | },
|
184 | 166 | {
|
185 | 167 | "colno": 12,
|
186 | 168 | "context_line": " return new (P || (P = Promise))(function (resolve, reject) {",
|
187 |
| - "filename": "[[FILENAME3]]", |
| 169 | + "filename": "[[FILENAME4]]", |
188 | 170 | "function": "__awaiter",
|
189 | 171 | "in_app": true,
|
190 |
| - "lineno": 4, |
| 172 | + "lineno": 27, |
191 | 173 | "module": "app",
|
192 | 174 | "post_context": [
|
193 | 175 | " function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }",
|
|
199 | 181 | "var __generator = (this && this.__generator) || function (thisArg, body) {"
|
200 | 182 | ],
|
201 | 183 | "pre_context": [
|
202 |
| - "\"use strict\";", |
| 184 | + " var result = {};", |
| 185 | + " if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);", |
| 186 | + " __setModuleDefault(result, mod);", |
| 187 | + " return result;", |
| 188 | + "};", |
203 | 189 | "var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {",
|
204 | 190 | " function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }"
|
205 | 191 | ]
|
206 | 192 | },
|
207 | 193 | {
|
208 |
| - "filename": "[[FILENAME4]]", |
| 194 | + "filename": "[[FILENAME5]]", |
209 | 195 | "function": "new Promise",
|
210 | 196 | "in_app": false,
|
211 | 197 | "module": "<anonymous>"
|
212 | 198 | },
|
213 | 199 | {
|
214 | 200 | "colno": 71,
|
215 | 201 | "context_line": " step((generator = generator.apply(thisArg, _arguments || [])).next());",
|
216 |
| - "filename": "[[FILENAME3]]", |
| 202 | + "filename": "[[FILENAME4]]", |
217 | 203 | "function": "?",
|
218 | 204 | "in_app": true,
|
219 |
| - "lineno": 8, |
| 205 | + "lineno": 31, |
220 | 206 | "module": "app",
|
221 | 207 | "post_context": [
|
222 | 208 | " });",
|
|
228 | 214 | " function step(op) {"
|
229 | 215 | ],
|
230 | 216 | "pre_context": [
|
231 |
| - "\"use strict\";", |
| 217 | + "};", |
232 | 218 | "var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {",
|
233 | 219 | " function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }",
|
234 | 220 | " return new (P || (P = Promise))(function (resolve, reject) {",
|
|
240 | 226 | {
|
241 | 227 | "colno": 53,
|
242 | 228 | "context_line": " function verb(n) { return function (v) { return step([n, v]); }; }",
|
243 |
| - "filename": "[[FILENAME3]]", |
| 229 | + "filename": "[[FILENAME4]]", |
244 | 230 | "function": "Object.next",
|
245 | 231 | "in_app": true,
|
246 |
| - "lineno": 14, |
| 232 | + "lineno": 37, |
247 | 233 | "module": "app",
|
248 | 234 | "post_context": [
|
249 | 235 | " function step(op) {",
|
|
267 | 253 | {
|
268 | 254 | "colno": 23,
|
269 | 255 | "context_line": " op = body.call(thisArg, _);",
|
270 |
| - "filename": "[[FILENAME3]]", |
| 256 | + "filename": "[[FILENAME4]]", |
271 | 257 | "function": "step",
|
272 | 258 | "in_app": true,
|
273 |
| - "lineno": 33, |
| 259 | + "lineno": 56, |
274 | 260 | "module": "app",
|
275 | 261 | "post_context": [
|
276 | 262 | " } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }",
|
|
292 | 278 | ]
|
293 | 279 | },
|
294 | 280 | {
|
295 |
| - "colno": 71, |
296 |
| - "context_line": " exceptionId = Sentry.captureException(new Error('This is an error'));", |
297 |
| - "filename": "[[FILENAME3]]", |
| 281 | + "colno": 79, |
| 282 | + "context_line": " exceptionId = Sentry.captureException(new Error('This is an error'));", |
| 283 | + "filename": "[[FILENAME4]]", |
298 | 284 | "function": "?",
|
299 | 285 | "in_app": true,
|
300 |
| - "lineno": 77, |
| 286 | + "lineno": 103, |
301 | 287 | "module": "app",
|
302 | 288 | "post_context": [
|
303 |
| - " return [4 /*yield*/, Sentry.flush(2000)];", |
304 |
| - " case 1:", |
305 |
| - " _a.sent();", |
306 |
| - " return [2 /*return*/, { exceptionId: exceptionId }];", |
307 |
| - " }", |
308 |
| - " });", |
309 |
| - " });" |
| 289 | + " return [4 /*yield*/, Sentry.flush(2000)];", |
| 290 | + " case 1:", |
| 291 | + " _a.sent();", |
| 292 | + " return [2 /*return*/, { exceptionId: exceptionId }];", |
| 293 | + " }", |
| 294 | + " });", |
| 295 | + " });" |
310 | 296 | ],
|
311 | 297 | "pre_context": [
|
312 |
| - " path: '/test-error',", |
313 |
| - " handler: function (request, h) {", |
314 |
| - " return __awaiter(this, void 0, void 0, function () {", |
315 |
| - " var exceptionId;", |
316 |
| - " return __generator(this, function (_a) {", |
317 |
| - " switch (_a.label) {", |
318 |
| - " case 0:" |
| 298 | + " path: '/test-error',", |
| 299 | + " handler: function (request, h) {", |
| 300 | + " return __awaiter(this, void 0, void 0, function () {", |
| 301 | + " var exceptionId;", |
| 302 | + " return __generator(this, function (_a) {", |
| 303 | + " switch (_a.label) {", |
| 304 | + " case 0:" |
319 | 305 | ]
|
320 | 306 | }
|
321 | 307 | ]
|
|
397 | 383 | "packages": [
|
398 | 384 | {
|
399 | 385 | "name": "npm:@sentry/node",
|
400 |
| - "version": "8.0.0-beta.6" |
| 386 | + "version": "8.0.0-rc.1" |
401 | 387 | }
|
402 | 388 | ],
|
403 |
| - "version": "8.0.0-beta.6" |
| 389 | + "version": "8.0.0-rc.1" |
404 | 390 | },
|
405 | 391 | "server_name": "D9M3PY4LQ7.local",
|
406 | 392 | "timestamp": "[[timestamp]]",
|
|
0 commit comments