fix(server): otel not working due to port conflicts after combining containers (#10078)

fix: otel not working due to port conflicts after combining containers

Fixes #9759
This commit is contained in:
Zack Pollard 2024-06-10 17:01:04 +01:00 committed by GitHub
parent 20efd82461
commit 2f2aecfb47
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 44 additions and 26 deletions

View file

@ -9,14 +9,16 @@ import { envName, excludePaths, isDev, serverVersion, WEB_ROOT } from 'src/const
import { ILoggerRepository } from 'src/interfaces/logger.interface';
import { WebSocketAdapter } from 'src/middleware/websocket.adapter';
import { ApiService } from 'src/services/api.service';
import { otelSDK } from 'src/utils/instrumentation';
import { otelStart } from 'src/utils/instrumentation';
import { useSwagger } from 'src/utils/misc';
const host = process.env.HOST;
async function bootstrap() {
process.title = 'immich-api';
otelSDK.start();
const otelPort = Number.parseInt(process.env.IMMICH_API_METRICS_PORT ?? '8081');
otelStart(otelPort);
const port = Number(process.env.IMMICH_PORT) || 3001;
const app = await NestFactory.create<NestExpressApplication>(ApiModule, { bufferLogs: true });