Skip to content

Commit 6754e36

Browse files
heiskrCopilot
andauthored
⚡️ Temporarily enable OTel diagnostics (#60902)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 1519615 commit 6754e36

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

src/observability/lib/tracing.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,14 @@ import { ExpressInstrumentation } from '@opentelemetry/instrumentation-express'
2626
import { HttpInstrumentation } from '@opentelemetry/instrumentation-http'
2727
import { UndiciInstrumentation } from '@opentelemetry/instrumentation-undici'
2828
import { NodeSDK } from '@opentelemetry/sdk-node'
29+
import { diag, DiagConsoleLogger, DiagLogLevel } from '@opentelemetry/api'
2930

30-
// For tracing diagnostics, uncomment these lines:
31-
// import { diag, DiagConsoleLogger, DiagLogLevel } from '@opentelemetry/api'
32-
// diag.setLogger(new DiagConsoleLogger(), DiagLogLevel.DEBUG)
33-
31+
// TEMPORARY: enable OTel diagnostic logging to investigate why traces aren't
32+
// arriving in the collector. See github/docs-engineering#6046. Revert once
33+
// the export pipeline is confirmed working.
3434
if (process.env.OTEL_EXPORTER_OTLP_TRACES_ENDPOINT) {
35+
diag.setLogger(new DiagConsoleLogger(), DiagLogLevel.INFO)
36+
3537
const sdk = new NodeSDK({
3638
serviceName: process.env.OTEL_SERVICE_NAME || 'docs-internal',
3739
traceExporter: new OTLPTraceExporter({}),

0 commit comments

Comments
 (0)