From 97bfa6ad69ade02d831ed0b12aaf96cede66f3a2 Mon Sep 17 00:00:00 2001 From: Luca Casonato Date: Fri, 3 Jan 2025 12:39:13 +0100 Subject: [PATCH] cleanup --- ext/telemetry/telemetry.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/ext/telemetry/telemetry.ts b/ext/telemetry/telemetry.ts index 1d8292fb98899a..6b92136459d727 100644 --- a/ext/telemetry/telemetry.ts +++ b/ext/telemetry/telemetry.ts @@ -1093,6 +1093,17 @@ export function bootstrap( default: break; } + + if (TRACING_ENABLED || METRICS_ENABLED) { + const otel = globalThis[SymbolFor("opentelemetry.js.api.1")] ??= {}; + if (TRACING_ENABLED) { + otel.tracing = new TracerProvider(); + otel.context = new ContextManager(); + } + if (METRICS_ENABLED) { + otel.metrics = new MeterProvider(); + } + } } export const telemetry = {