File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -27,7 +27,6 @@ import { EventLoggingModule } from './event-logging/event-logging.module';
2727import { GqlModule } from './gql/gql.module' ;
2828import { NewslettersModule } from './newsletters/newsletters.module' ;
2929import { SubscriptionModule } from './subscriptions/subscriptions.module' ;
30- import { LOGGER_PROVIDER } from '@fxa/shared/log' ;
3130
3231const version = getVersionInfo ( __dirname ) ;
3332
Original file line number Diff line number Diff line change 77import './monitoring' ;
88
99import { NestApplicationOptions } from '@nestjs/common' ;
10- import { NestFactory } from '@nestjs/core' ;
10+ import { HttpAdapterHost , NestFactory } from '@nestjs/core' ;
1111import { NestExpressApplication } from '@nestjs/platform-express' ;
1212import { allowlistGqlQueries } from 'fxa-shared/nestjs/gql/gql-allowlist' ;
1313import helmet from 'helmet' ;
14- import { AppModule } from './app.module' ;
15- import Config , { AppConfig } from './config' ;
1614import cors from 'cors' ;
17- import { SentryGlobalFilter } from '@sentry/nestjs/setup' ;
1815import * as Sentry from '@sentry/nestjs' ;
16+ import { SentryGlobalFilter } from '@sentry/nestjs/setup' ;
17+
18+ import { AppModule } from './app.module' ;
19+ import Config , { AppConfig } from './config' ;
1920
2021const appConfig = Config . getProperties ( ) as AppConfig ;
2122
@@ -29,8 +30,9 @@ async function bootstrap() {
2930 nestConfig
3031 ) ;
3132
32- // As of sentry v9, this should handle both regular requests and graphql requests.
33- app . useGlobalFilters ( new SentryGlobalFilter ( ) ) ;
33+ // Register Sentry exception filter with proper HttpAdapterHost
34+ const { httpAdapter } = app . get ( HttpAdapterHost ) ;
35+ app . useGlobalFilters ( new SentryGlobalFilter ( httpAdapter ) ) ;
3436
3537 app . use (
3638 cors ( {
Original file line number Diff line number Diff line change 22 * License, v. 2.0. If a copy of the MPL was not distributed with this
33 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
44import { Module } from '@nestjs/common' ;
5- import { ConfigModule , ConfigService } from '@nestjs/config' ;
5+ import { ConfigModule } from '@nestjs/config' ;
66import { ScheduleModule } from '@nestjs/schedule' ;
77import { HealthModule } from 'fxa-shared/nestjs/health/health.module' ;
88import { LoggerModule } from 'fxa-shared/nestjs/logger/logger.module' ;
9- import { MozLoggerService } from 'fxa-shared/nestjs/logger/logger.service' ;
109import { MetricsFactory } from 'fxa-shared/nestjs/metrics.service' ;
1110import { getVersionInfo } from 'fxa-shared/nestjs/version' ;
1211
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ import { SentryGlobalFilter } from '@sentry/nestjs/setup';
1111
1212import { NestApplicationOptions } from '@nestjs/common' ;
1313import { ConfigService } from '@nestjs/config' ;
14- import { NestFactory } from '@nestjs/core' ;
14+ import { HttpAdapterHost , NestFactory } from '@nestjs/core' ;
1515import mozLog from 'mozlog' ;
1616
1717import { initTracing } from 'fxa-shared/tracing/node-tracing' ;
@@ -34,7 +34,9 @@ async function bootstrap() {
3434 const config : ConfigService < AppConfig > = app . get ( ConfigService ) ;
3535 const proxyConfig = config . get ( 'proxy' ) as AppConfig [ 'proxy' ] ;
3636
37- app . useGlobalFilters ( new SentryGlobalFilter ( ) ) ;
37+ // Register Sentry exception filter with proper HttpAdapterHost
38+ const { httpAdapter } = app . get ( HttpAdapterHost ) ;
39+ app . useGlobalFilters ( new SentryGlobalFilter ( httpAdapter ) ) ;
3840
3941 // Starts listening for shutdown hooks
4042 app . enableShutdownHooks ( ) ;
Original file line number Diff line number Diff line change @@ -52,7 +52,7 @@ const version = getVersionInfo(__dirname);
5252 extraHealthData : ( ) => db . dbHealthCheck ( ) ,
5353 } ) ,
5454 } ) ,
55- CustomsModule
55+ CustomsModule ,
5656 ] ,
5757 controllers : [ ] ,
5858 providers : [
Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ import { StatsDService } from '@fxa/shared/metrics/statsd';
1616import helmet from 'helmet' ;
1717
1818import { NestApplicationOptions } from '@nestjs/common' ;
19- import { NestFactory } from '@nestjs/core' ;
19+ import { HttpAdapterHost , NestFactory } from '@nestjs/core' ;
2020import { NestExpressApplication } from '@nestjs/platform-express' ;
2121
2222import { AppModule } from './app.module' ;
@@ -34,8 +34,9 @@ async function bootstrap() {
3434 nestConfig
3535 ) ;
3636
37- // As of sentry v9, this should handle both regular requests and graphql requests.
38- app . useGlobalFilters ( new SentryGlobalFilter ( ) ) ;
37+ // Register Sentry exception filter with proper HttpAdapterHost
38+ const { httpAdapter } = app . get ( HttpAdapterHost ) ;
39+ app . useGlobalFilters ( new SentryGlobalFilter ( httpAdapter ) ) ;
3940
4041 // Configure allowlisting of gql queries
4142 app . use ( bodyParser . json ( ) ) ;
You can’t perform that action at this time.
0 commit comments