feat(metrics): add MetricsService, HttpMetricsInterceptor, and metric constants
- Extract metric names into constants with goodgo_ prefix for business metrics - Add MetricsService for type-safe metric recording - Add HttpMetricsInterceptor for automatic request duration/count tracking - Register interceptor globally via APP_INTERCEPTOR - Include linter auto-fixes for test files Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { type MiddlewareConsumer, Module, type NestModule } from '@nestjs/common';
|
||||
import { APP_FILTER, APP_GUARD } from '@nestjs/core';
|
||||
import { APP_FILTER, APP_GUARD, APP_INTERCEPTOR } from '@nestjs/core';
|
||||
import { CqrsModule } from '@nestjs/cqrs';
|
||||
import { ThrottlerModule } from '@nestjs/throttler';
|
||||
import { SentryGlobalFilter, SentryModule } from '@sentry/nestjs/setup';
|
||||
@@ -8,7 +8,7 @@ import { AnalyticsModule } from '@modules/analytics';
|
||||
import { AuthModule } from '@modules/auth';
|
||||
import { ListingsModule } from '@modules/listings';
|
||||
import { McpIntegrationModule } from '@modules/mcp';
|
||||
import { MetricsModule } from '@modules/metrics';
|
||||
import { HttpMetricsInterceptor, MetricsModule } from '@modules/metrics';
|
||||
import { NotificationsModule } from '@modules/notifications';
|
||||
import { PaymentsModule } from '@modules/payments';
|
||||
import { SearchModule } from '@modules/search';
|
||||
@@ -68,6 +68,10 @@ import { AppController } from './app.controller';
|
||||
provide: APP_GUARD,
|
||||
useClass: ThrottlerBehindProxyGuard,
|
||||
},
|
||||
{
|
||||
provide: APP_INTERCEPTOR,
|
||||
useClass: HttpMetricsInterceptor,
|
||||
},
|
||||
],
|
||||
})
|
||||
export class AppModule implements NestModule {
|
||||
|
||||
Reference in New Issue
Block a user