Add more data to Sentry
This commit is contained in:
parent
3abe8f1a79
commit
62101e7739
2 changed files with 13 additions and 1 deletions
13
app.js
13
app.js
|
@ -29,7 +29,11 @@ Sentry.init({
|
||||||
|
|
||||||
const app = new koa();
|
const app = new koa();
|
||||||
|
|
||||||
app.on('error', (err) => {
|
if (process.env.NODE_ENV === 'production') {
|
||||||
|
app.proxy = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
app.on('error', (err, ctx) => {
|
||||||
Sentry.captureException(err);
|
Sentry.captureException(err);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -45,6 +49,13 @@ app.use(serve('public', { maxage: 31536000000 }));
|
||||||
const manifest = JSON.parse(fs.readFileSync(path.join(__dirname, '/public/dist/manifest.json')));
|
const manifest = JSON.parse(fs.readFileSync(path.join(__dirname, '/public/dist/manifest.json')));
|
||||||
|
|
||||||
app.use(async function(ctx, next) {
|
app.use(async function(ctx, next) {
|
||||||
|
Sentry.configureScope(scope => {
|
||||||
|
scope.setExtra('Request', {
|
||||||
|
'url': ctx.request.url,
|
||||||
|
'method': ctx.request.method,
|
||||||
|
'user-agent': ctx.request.header['user-agent'],
|
||||||
|
});
|
||||||
|
});
|
||||||
ctx.state.manifest = manifest;
|
ctx.state.manifest = manifest;
|
||||||
await next();
|
await next();
|
||||||
});
|
});
|
||||||
|
|
|
@ -21,6 +21,7 @@ services:
|
||||||
AWS_SECRET_ACCESS_KEY:
|
AWS_SECRET_ACCESS_KEY:
|
||||||
AWS_TAG:
|
AWS_TAG:
|
||||||
SLACK_TOKEN:
|
SLACK_TOKEN:
|
||||||
|
SENTRY_DSN:
|
||||||
volumes:
|
volumes:
|
||||||
- ./:/app:cached
|
- ./:/app:cached
|
||||||
- node_modules:/app/node_modules
|
- node_modules:/app/node_modules
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue