From 6754e36a392066c97add09d373f00d58a39d298f Mon Sep 17 00:00:00 2001 From: Kevin Heis Date: Mon, 4 May 2026 09:37:59 -0700 Subject: [PATCH] =?UTF-8?q?=E2=9A=A1=EF=B8=8F=20Temporarily=20enable=20OTe?= =?UTF-8?q?l=20diagnostics=20(#60902)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- src/observability/lib/tracing.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/observability/lib/tracing.ts b/src/observability/lib/tracing.ts index 715bf835deb8..1e782f262be0 100644 --- a/src/observability/lib/tracing.ts +++ b/src/observability/lib/tracing.ts @@ -26,12 +26,14 @@ import { ExpressInstrumentation } from '@opentelemetry/instrumentation-express' import { HttpInstrumentation } from '@opentelemetry/instrumentation-http' import { UndiciInstrumentation } from '@opentelemetry/instrumentation-undici' import { NodeSDK } from '@opentelemetry/sdk-node' +import { diag, DiagConsoleLogger, DiagLogLevel } from '@opentelemetry/api' -// For tracing diagnostics, uncomment these lines: -// import { diag, DiagConsoleLogger, DiagLogLevel } from '@opentelemetry/api' -// diag.setLogger(new DiagConsoleLogger(), DiagLogLevel.DEBUG) - +// TEMPORARY: enable OTel diagnostic logging to investigate why traces aren't +// arriving in the collector. See github/docs-engineering#6046. Revert once +// the export pipeline is confirmed working. if (process.env.OTEL_EXPORTER_OTLP_TRACES_ENDPOINT) { + diag.setLogger(new DiagConsoleLogger(), DiagLogLevel.INFO) + const sdk = new NodeSDK({ serviceName: process.env.OTEL_SERVICE_NAME || 'docs-internal', traceExporter: new OTLPTraceExporter({}),