deno/tests/specs/cli/otel_basic/http_propagators.ts
Bartek Iwańczuk 14f9d77f3d
Some checks are pending
ci / build libs (push) Blocked by required conditions
ci / pre-build (push) Waiting to run
ci / test debug linux-aarch64 (push) Blocked by required conditions
ci / test release linux-aarch64 (push) Blocked by required conditions
ci / test debug macos-aarch64 (push) Blocked by required conditions
ci / test release macos-aarch64 (push) Blocked by required conditions
ci / bench release linux-x86_64 (push) Blocked by required conditions
ci / lint debug linux-x86_64 (push) Blocked by required conditions
ci / lint debug macos-x86_64 (push) Blocked by required conditions
ci / lint debug windows-x86_64 (push) Blocked by required conditions
ci / test debug linux-x86_64 (push) Blocked by required conditions
ci / test release linux-x86_64 (push) Blocked by required conditions
ci / test debug macos-x86_64 (push) Blocked by required conditions
ci / test release macos-x86_64 (push) Blocked by required conditions
ci / test debug windows-x86_64 (push) Blocked by required conditions
ci / test release windows-x86_64 (push) Blocked by required conditions
ci / publish canary (push) Blocked by required conditions
feat(otel): stabilize OpenTelemetry support (#29822)
This commit stabilizes support for OpenTelemetry in Deno,
effectively removing the need to use `--unstable-otel` flag
or using `{ "unstable": ["otel"] }` option in the config file.

Supersedes https://github.com/denoland/deno/pull/29500
Closes https://github.com/denoland/deno/issues/29477
2025-06-24 16:49:04 +02:00

32 lines
827 B
TypeScript

import { assertEquals } from "@std/assert";
const command1 = new Deno.Command(Deno.execPath(), {
env: {
"OTEL_DENO_METRICS": "false",
"OTEL_SERVICE_NAME": "server_1",
"DENO_UNSTABLE_OTEL_DETERMINISTIC": "1",
},
args: ["run", "-A", "http_propagators_1.ts"],
});
const p1 = command1.output();
await new Promise((resolve) => setTimeout(resolve, 1000));
const command2 = new Deno.Command(Deno.execPath(), {
env: {
"OTEL_DENO_METRICS": "false",
"OTEL_SERVICE_NAME": "server_2",
"DENO_UNSTABLE_OTEL_DETERMINISTIC": "2",
},
args: ["run", "-A", "http_propagators_2.ts"],
});
const p2 = command2.output();
await new Promise((resolve) => setTimeout(resolve, 1000));
const res = await fetch("http://localhost:8000");
assertEquals(await res.text(), "Hello World!");
await Promise.all([p1, p2]);