-
Notifications
You must be signed in to change notification settings - Fork 37
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
feat(apm): added apm configuration setup #167
Conversation
What does this do? Can you add a description to you PR. There are prettier errors in the ordering of imports. Please make sure to install the prettier extension for vscode before committing to this repo. The name of the PR should also follow standard commit norms. So : chore(server): add apm |
packages/server/src/api.ts
Outdated
const apmEnabled = yn(process.env.APM_ENABLED) | ||
|
||
if (apmEnabled) { | ||
Sentry.init({ | ||
integrations: [new Sentry.Integrations.Http({})] | ||
}) | ||
|
||
this.root.use(Sentry.Handlers.requestHandler()) | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you extract that in a setupApm
function. For the bottom bit, you can extract that in a setupApmErrorHandler
function. We want to avoid having anything complicated happen in this main setup
function. We mostly just call other services's setup function from here and do some small single line stuff.
packages/server/src/api.ts
Outdated
@@ -9,6 +9,8 @@ import { MessageApi } from './messages/api' | |||
import { SocketManager } from './socket/manager' | |||
import { SyncApi } from './sync/api' | |||
import { UserApi } from './users/api' | |||
import * as Sentry from '@sentry/node' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make sure that ESLint and Prettier run on your code. This should be automatic when using VSCode.
@michaelmass can you fix these issues so we can merge this? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
This adds the Sentry sdk inside the messaging server to monitor application metrics (apm).