/* src/main.ts */
import { NestFactory } from '@nestjs/core';
import { AppModule } from './app.module';
import { nestTracerMiddleware } from './src/index';
async function bootstrap() {
const app = await NestFactory.create(AppModule);
app.use(
nestTracerMiddleware(
'service-name',
{ name: 'service-name', version: '0.0.1' },
{
type: 'jaeger',
serviceName: 'service-name',
host: '192.168.8.207',
port: 6832,
},
),
);
await app.listen(3000);
}
bootstrap();
/* src/main.ts */
import { NestFactory } from '@nestjs/core';
import { AppModule } from './app.module';
import { nestTracerMiddleware } from 'tracing-nestjs';
import {
FastifyAdapter,
NestFastifyApplication,
} from '@nestjs/platform-fastify';
async function bootstrap() {
const app = await NestFactory.create<NestFastifyApplication>(
AppModule,
new FastifyAdapter(),
);
app.use(
nestTracerMiddleware(
'service-name',
{ name: 'service-name', version: '0.0.1' },
{
type: 'jaeger',
serviceName: 'service-name',
host: '192.168.8.207',
port: 6832,
},
),
);
await app.listen(3000);
}
bootstrap();