Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 16 additions & 9 deletions apps/api/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,22 @@ import { AuthModule } from "./auth/auth.module";
import { RolesGlobalGuard } from "./auth/role/roles.global.guard";
import { winstonOptions } from "./logger/config";

// Initialize Instana APM collector for application monitoring
instana();

/**
* Bootstrap function - initializes and configures the NestJS application
* Sets up middleware, security, API documentation, and graceful shutdown
*
* @throws {Error} When application fails to start or configuration is invalid
*/
if (process.env.NODE_ENV === "production") {
instana({
level: "warn",
tracing: {
stackTraceLength: 20,
http: {
captureAsyncContext: true,
extraHttpHeadersToCapture: [
"user-agent",
"x-request-id",
"x-correlation-id",
],
},
},
});
}
async function bootstrap() {
const logger = new Logger("Bootstrap");

Expand Down
19 changes: 17 additions & 2 deletions apps/web/next.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,21 @@
/** @type {import('next').NextConfig} */
const instana = require("@instana/collector");
instana();
if (process.env.NODE_ENV === "production") {
const instana = require("@instana/collector");
instana({
level: "warn",
tracing: {
stackTraceLength: 20,
http: {
captureAsyncContext: true,
extraHttpHeadersToCapture: [
"user-agent",
"x-request-id",
"x-correlation-id",
],
},
},
});
}
const nextConfig = {
reactStrictMode: true,
compiler: {
Expand Down
Loading