-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
/
Copy pathscenario.js
34 lines (26 loc) · 872 Bytes
/
scenario.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
const { loggingTransport, startExpressServerAndSendPortToRunner } = require('@sentry-internal/node-integration-tests');
const Sentry = require('@sentry/node');
Sentry.init({
dsn: 'https://[email protected]/1337',
release: '1.0',
tracesSampleRate: 1.0,
transport: loggingTransport,
integrations: [Sentry.dataloaderIntegration()],
});
const PORT = 8008;
// Stop the process from exiting before the transaction is sent
setInterval(() => {}, 1000);
const run = async () => {
const express = require('express');
const Dataloader = require('dataloader');
const app = express();
const dataloader = new Dataloader(async keys => keys.map((_, idx) => idx), {
cache: false,
});
app.get('/', (req, res) => {
const user = dataloader.load('user-1');
res.send(user);
});
startExpressServerAndSendPortToRunner(app, PORT);
};
run();