Add profiling (#38)

* capture caught exceptions

* add profiling

* Use 0.0.12 for now
This commit is contained in:
Dustin Decker 2023-01-31 07:54:14 -08:00 committed by GitHub
parent 1b7aa3258c
commit 42fcdf0e54
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 1014 additions and 52 deletions

View file

@ -1,8 +1,9 @@
FROM node:16
FROM node:16-bullseye
RUN mkdir /app/
WORKDIR /app/
RUN npm install pm2 -g
RUN apt update; apt install -y libstdc++6
COPY front-end/ /app/front-end/
WORKDIR /app/front-end/

17
app.js
View file

@ -19,6 +19,7 @@ const validate = require('express-jsonschema').validate;
const constants = require('./constants.js');
const Sentry = require('@sentry/node');
const Tracing = require("@sentry/tracing");
const Profiling = require("@sentry/profiling-node");
function set_secure_headers(req, res) {
res.set("X-XSS-Protection", "mode=block");
@ -58,15 +59,15 @@ async function get_app_server() {
Sentry.init({
dsn: process.env.SENTRY_DSN,
integrations: [
// enable HTTP calls tracing
new Sentry.Integrations.Http({ tracing: true }),
// enable Express.js middleware tracing
new Tracing.Integrations.Express({ app }),
// enable HTTP calls tracing
new Sentry.Integrations.Http({ tracing: true }),
// enable Express.js middleware tracing
new Tracing.Integrations.Express({ app }),
// add beta profiling integration
new Profiling.ProfilingIntegration()
],
// Set tracesSampleRate to 1.0 to capture 100%
// of transactions for performance monitoring.
// We recommend adjusting this value in production
// 1.0 is 100% capture rate
profilesSampleRate: 1.0,
tracesSampleRate: 0.01,
});

1045
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -15,6 +15,7 @@
"@google-cloud/storage": "^6.9.0",
"@sendgrid/mail": "^7.7.0",
"@sentry/node": "^7.34.0",
"@sentry/profiling-node": "^0.0.12",
"@sentry/tracing": "^7.34.0",
"@truffledustin/node-client-sessions": "^0.8.0",
"bcrypt": "^5.0.1",