Skip to content

Commit bba3d9a

Browse files
committed
Do not capture on documentRequest level
1 parent a445083 commit bba3d9a

File tree

1 file changed

+18
-28
lines changed

1 file changed

+18
-28
lines changed

packages/remix/src/utils/instrumentServer.ts

Lines changed: 18 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -190,38 +190,28 @@ function makeWrappedDocumentRequestFunction(remixVersion: number) {
190190
context: EntryContext,
191191
loadContext?: Record<string, unknown>,
192192
): Promise<Response> {
193-
let res: Response;
194-
195193
const activeTransaction = getActiveTransaction();
196194

197-
try {
198-
const span = activeTransaction?.startChild({
199-
op: 'function.remix.document_request',
200-
origin: 'auto.function.remix',
201-
description: activeTransaction.name,
202-
tags: {
203-
method: request.method,
204-
url: request.url,
205-
},
206-
});
195+
const span = activeTransaction?.startChild({
196+
op: 'function.remix.document_request',
197+
origin: 'auto.function.remix',
198+
description: activeTransaction.name,
199+
tags: {
200+
method: request.method,
201+
url: request.url,
202+
},
203+
});
207204

208-
res = await origDocumentRequestFunction.call(
209-
this,
210-
request,
211-
responseStatusCode,
212-
responseHeaders,
213-
context,
214-
loadContext,
215-
);
216-
217-
span?.finish();
218-
} catch (err) {
219-
if (!FUTURE_FLAGS?.v2_errorBoundary && remixVersion !== 2) {
220-
await captureRemixServerException(err, 'documentRequest', request);
221-
}
205+
const res = await origDocumentRequestFunction.call(
206+
this,
207+
request,
208+
responseStatusCode,
209+
responseHeaders,
210+
context,
211+
loadContext,
212+
);
222213

223-
throw err;
224-
}
214+
span?.finish();
225215

226216
return res;
227217
};

0 commit comments

Comments
 (0)