From 82f39756219f8b890eeb7f3abbf9d73cdbc6fc4c Mon Sep 17 00:00:00 2001 From: Stef Lewandowski Date: Thu, 29 Aug 2024 16:30:59 +0100 Subject: [PATCH] Add a line of debug for staging/production so we can see that datadog is being initialised --- apps/nextjs/package.json | 1 + packages/core/src/tracing/baseTracing.ts | 9 +++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/apps/nextjs/package.json b/apps/nextjs/package.json index 8418e9f92..6c85d18c8 100644 --- a/apps/nextjs/package.json +++ b/apps/nextjs/package.json @@ -9,6 +9,7 @@ "clean": "rm -rf .next .turbo node_modules", "dev": "concurrently \"pnpm dev-server\" \"node scripts/local-dev.mjs\"", "dev-server": "pnpm with-env next dev --port 2525 | pino-pretty -C", + "dev-trace-deprecation": "NODE_OPTIONS=\"--trace-deprecation\" next dev --port 2525 | pino-pretty -C", "lint": "next lint", "lint-fix": "next lint --fix", "start": "next start", diff --git a/packages/core/src/tracing/baseTracing.ts b/packages/core/src/tracing/baseTracing.ts index 666fb8601..4818ea0e7 100644 --- a/packages/core/src/tracing/baseTracing.ts +++ b/packages/core/src/tracing/baseTracing.ts @@ -34,7 +34,7 @@ export function initializeTracer(options: DatadogOptions) { `Initialized no-op tracer for ${isTest ? "test" : "local development"} environment`, ); } else { - tracer.init({ + const initialisationOptions = { env: options.env || environment, service: options.service || "oak-ai", hostname, @@ -45,7 +45,12 @@ export function initializeTracer(options: DatadogOptions) { sampleRate: options.sampleRate || 1, profiling: options.profiling !== undefined ? options.profiling : true, plugins: options.plugins !== undefined ? options.plugins : false, - }); + }; + console.log( + "Initializing Datadog tracer with options", + initialisationOptions, + ); + tracer.init(initialisationOptions); } }