-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
ref(node): Streamline vendored fs instrumentation #21532
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
base: develop
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| import * as Sentry from '@sentry/node'; | ||
| import { loggingTransport, startExpressServerAndSendPortToRunner } from '@sentry-internal/node-integration-tests'; | ||
|
|
||
| Sentry.init({ | ||
| dsn: 'https://public@dsn.ingest.sentry.io/1337', | ||
| release: '1.0', | ||
| transport: loggingTransport, | ||
| tracesSampleRate: 1, | ||
| integrations: [ | ||
| // Only record error messages - file paths must NOT be recorded | ||
| Sentry.fsIntegration({ | ||
| recordErrorMessagesAsSpanAttributes: true, | ||
| }), | ||
| ], | ||
| }); | ||
|
|
||
| import express from 'express'; | ||
| import * as fs from 'fs'; | ||
| import * as path from 'path'; | ||
|
|
||
| const app = express(); | ||
|
|
||
| app.get('/readFile', async (_, res) => { | ||
| await fs.promises.readFile(path.join(__dirname, 'fixtures', 'some-file.txt'), 'utf-8'); | ||
| res.send('done'); | ||
| }); | ||
Check failureCode scanning / CodeQL Missing rate limiting High
This route handler performs
a file system access Error loading related location Loading |
||
|
|
||
| app.get('/readFile-error', async (_, res) => { | ||
| try { | ||
| await fs.promises.readFile(path.join(__dirname, 'fixtures', 'some-file-that-doesnt-exist.txt'), 'utf-8'); | ||
| } catch { | ||
| // noop | ||
| } | ||
| res.send('done'); | ||
| }); | ||
Check failureCode scanning / CodeQL Missing rate limiting High
This route handler performs
a file system access Error loading related location Loading |
||
|
mydea marked this conversation as resolved.
Dismissed
|
||
|
|
||
| Sentry.setupExpressErrorHandler(app); | ||
|
|
||
| startExpressServerAndSendPortToRunner(app); | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| import * as Sentry from '@sentry/node'; | ||
| import { loggingTransport, startExpressServerAndSendPortToRunner } from '@sentry-internal/node-integration-tests'; | ||
|
|
||
| Sentry.init({ | ||
| dsn: 'https://public@dsn.ingest.sentry.io/1337', | ||
| release: '1.0', | ||
| transport: loggingTransport, | ||
| tracesSampleRate: 1, | ||
| integrations: [ | ||
| // Only record file paths - error messages must NOT be recorded | ||
| Sentry.fsIntegration({ | ||
| recordFilePaths: true, | ||
| }), | ||
| ], | ||
| }); | ||
|
|
||
| import express from 'express'; | ||
| import * as fs from 'fs'; | ||
| import * as path from 'path'; | ||
|
|
||
| const app = express(); | ||
|
|
||
| app.get('/readFile', async (_, res) => { | ||
| await fs.promises.readFile(path.join(__dirname, 'fixtures', 'some-file.txt'), 'utf-8'); | ||
| res.send('done'); | ||
| }); | ||
Check failureCode scanning / CodeQL Missing rate limiting High
This route handler performs
a file system access Error loading related location Loading |
||
|
mydea marked this conversation as resolved.
Dismissed
|
||
|
|
||
| app.get('/readFile-error', async (_, res) => { | ||
| try { | ||
| await fs.promises.readFile(path.join(__dirname, 'fixtures', 'some-file-that-doesnt-exist.txt'), 'utf-8'); | ||
| } catch { | ||
| // noop | ||
| } | ||
| res.send('done'); | ||
| }); | ||
Check failureCode scanning / CodeQL Missing rate limiting High
This route handler performs
a file system access Error loading related location Loading |
||
|
mydea marked this conversation as resolved.
Dismissed
|
||
|
|
||
| Sentry.setupExpressErrorHandler(app); | ||
|
|
||
| startExpressServerAndSendPortToRunner(app); | ||
Uh oh!
There was an error while loading. Please reload this page.