summaryrefslogtreecommitdiff
path: root/runtime/js/90_deno_ns.js
diff options
context:
space:
mode:
authorsnek <snek@deno.com>2024-11-13 11:38:46 +0100
committerGitHub <noreply@github.com>2024-11-13 10:38:46 +0000
commitaa546189be730163ee5370029e4dfdb3b454ab96 (patch)
tree4407643e6908f82c9ac31d9ae5faf04b3ab8d413 /runtime/js/90_deno_ns.js
parent7becd83a3828b35331d0fcb82c64146e520f154b (diff)
feat: OpenTelemetry Tracing API and Exporting (#26710)
Initial import of OTEL code supporting tracing. Metrics soon to come. Implements APIs for https://jsr.io/@deno/otel so that code using OpenTelemetry.js just works tm. There is still a lot of work to do with configuration and adding built-in tracing to core APIs, which will come in followup PRs. --------- Co-authored-by: Luca Casonato <hello@lcas.dev>
Diffstat (limited to 'runtime/js/90_deno_ns.js')
-rw-r--r--runtime/js/90_deno_ns.js19
1 files changed, 13 insertions, 6 deletions
diff --git a/runtime/js/90_deno_ns.js b/runtime/js/90_deno_ns.js
index fd2ac00f2..11f618ce2 100644
--- a/runtime/js/90_deno_ns.js
+++ b/runtime/js/90_deno_ns.js
@@ -29,6 +29,7 @@ import * as tty from "ext:runtime/40_tty.js";
import * as kv from "ext:deno_kv/01_db.ts";
import * as cron from "ext:deno_cron/01_cron.ts";
import * as webgpuSurface from "ext:deno_webgpu/02_surface.js";
+import * as telemetry from "ext:runtime/telemetry.js";
const denoNs = {
Process: process.Process,
@@ -134,7 +135,7 @@ const denoNs = {
createHttpClient: httpClient.createHttpClient,
};
-// NOTE(bartlomieju): keep IDs in sync with `cli/main.rs`
+// NOTE(bartlomieju): keep IDs in sync with `runtime/lib.rs`
const unstableIds = {
broadcastChannel: 1,
cron: 2,
@@ -143,11 +144,12 @@ const unstableIds = {
http: 5,
kv: 6,
net: 7,
- process: 8,
- temporal: 9,
- unsafeProto: 10,
- webgpu: 11,
- workerOptions: 12,
+ otel: 8,
+ process: 9,
+ temporal: 10,
+ unsafeProto: 11,
+ webgpu: 12,
+ workerOptions: 13,
};
const denoNsUnstableById = { __proto__: null };
@@ -181,4 +183,9 @@ denoNsUnstableById[unstableIds.webgpu] = {
// denoNsUnstableById[unstableIds.workerOptions] = { __proto__: null }
+denoNsUnstableById[unstableIds.otel] = {
+ tracing: telemetry.tracing,
+ metrics: telemetry.metrics,
+};
+
export { denoNs, denoNsUnstableById, unstableIds };