Skip to content
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

task(admin-server): Fix admin server startup times and some refactor #17938

Merged
merged 1 commit into from
Oct 31, 2024

Conversation

dschom
Copy link
Contributor

@dschom dschom commented Oct 30, 2024

Because

  • We want to improve startup performance of admin-server
  • We determined using the @sentry/node package in the admin-server was source of slowdown
  • Using @sentry/nestjs made a big improvement in startup time.

This pull request

  • Switches to using @sentry/nestjs integration for admin-server
  • Refactors libs/sentry into three distinct contexts libs/sentry-nestjs, libs/sentry-node, libs/sentry-browser, and libs/sentry-utils
  • Extracts common functions to libs/sentry-utils so they can be reused.

Issue that this pull request solves

Closes: FXA-10402, FXA-10460, FXA-10648

Checklist

Put an x in the boxes that apply

  • My commit is GPG signed.
  • If applicable, I have modified or added tests which pass locally.
  • I have added necessary documentation (if appropriate).
  • I have verified that my changes render correctly in RTL (if appropriate).

Screenshots (Optional)

Please attach the screenshots of the changes made in case of change in user interface.

Other information (Optional)

We still need a follow ups to clean this up which involves removing libs/sentry and removing fxa-shared/sentry, and fxa-shared/otel. Unfortunately this effort spiraled out of control due to a lack of typescript support (or quirks with existing tsconfigs) in our workspace packages. Special notes about this have been added to related tickets in the backlog under this epic. A semi broken attempt at fully porting this can be found here 😬.

Also here's some notes on timing from local machine:

@sentry/node:7^ - With Sentry included - 3,566ms

@sentry/node:8^ - With Sentry included - 25,906ms
@sentry/node:8^ - With Sentry and all integrations filtered - 23,884ms
@sentry/node:8^ - With Sentry commented out entirely - 3,673ms
@sentry/nestjs:8^ - With Sentry - 8,558ms

@dschom dschom requested a review from a team as a code owner October 30, 2024 16:40
@dschom dschom changed the title wip - just for admin-server task(admin-server): Fix startup times and some refactor Oct 30, 2024
@dschom dschom force-pushed the FXA-10460-admin-server branch 2 times, most recently from 65b9e6e to 763c096 Compare October 30, 2024 17:18
@dschom dschom force-pushed the FXA-10460-admin-server branch 3 times, most recently from 14b9341 to 47dcc5d Compare October 30, 2024 18:25
@dschom dschom changed the title task(admin-server): Fix startup times and some refactor task(admin-server): Fix admin server startup times and some refactor Oct 30, 2024
Because:
- We want to improve startup performance of admin-server
- We determined using the @sentry/node package in the admin-server was source of slowdown
- Using @sentry/nestjs made a big improvement in startup time.

This Commit:
- Switches to using @sentry/nestjs integration for admin-server
- Refactors libs/sentry into three distinct contexts libs/sentry-nestjs, libs/sentry-node, libs/sentry-browser, and libs/sentry-utils
- Extracts common functions to libs/sentry-utils so they can be reused.
@@ -17,7 +17,7 @@ import { DEFAULT_LOCALE, EN_GB_LOCALES } from './l10n.constants';
*
*/
export function parseAcceptLanguage(
acceptLanguage: string,
acceptLanguage?: string,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a null check, but with == so I guess this is fine.

Copy link
Contributor

@chenba chenba left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🏅 LGTM. Thanks, @dschom.

If you are up for it, you should give a talk on OTEL and Sentry to FxA+SubPlat. Lay that expertise on us. 🙇

@dschom dschom merged commit 73b7100 into main Oct 31, 2024
25 checks passed
@dschom dschom deleted the FXA-10460-admin-server branch October 31, 2024 21:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants