forked from mtusi2026/mtusi2026lab6
feat: instrument api, relay and worker with opentelemetry
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import './telemetry/register';
|
||||
import { Logger } from '@nestjs/common';
|
||||
import { NestFactory } from '@nestjs/core';
|
||||
import {
|
||||
@@ -8,6 +9,8 @@ import { AppModule } from './app.module';
|
||||
import { configureApp } from './configure-app';
|
||||
import { setupSwagger } from './docs/swagger';
|
||||
import { enableGracefulShutdown } from './health/shutdown';
|
||||
import { registerHttpTelemetry } from './telemetry/http';
|
||||
import { JsonLogger } from './telemetry/json-logger';
|
||||
|
||||
async function bootstrap(): Promise<void> {
|
||||
const app = await NestFactory.create<NestFastifyApplication>(
|
||||
@@ -15,10 +18,12 @@ async function bootstrap(): Promise<void> {
|
||||
new FastifyAdapter(),
|
||||
{
|
||||
bufferLogs: true,
|
||||
logger: new JsonLogger(),
|
||||
},
|
||||
);
|
||||
|
||||
configureApp(app);
|
||||
registerHttpTelemetry(app.getHttpAdapter().getInstance());
|
||||
setupSwagger(app);
|
||||
enableGracefulShutdown(app);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user