summaryrefslogtreecommitdiff
path: root/tests/specs/cli/otel_basic/child.ts
diff options
context:
space:
mode:
Diffstat (limited to 'tests/specs/cli/otel_basic/child.ts')
-rw-r--r--tests/specs/cli/otel_basic/child.ts20
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/specs/cli/otel_basic/child.ts b/tests/specs/cli/otel_basic/child.ts
new file mode 100644
index 000000000..72cffd9f0
--- /dev/null
+++ b/tests/specs/cli/otel_basic/child.ts
@@ -0,0 +1,20 @@
+// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
+
+async function inner() {
+ using _span = new Deno.tracing.Span("inner span");
+ console.log("log 1");
+ await 1;
+ console.log("log 2");
+}
+
+Deno.serve({
+ port: 0,
+ onListen({ port }) {
+ console.log(port.toString());
+ },
+ handler: async (_req) => {
+ using _span = new Deno.tracing.Span("outer span");
+ await inner();
+ return new Response(null, { status: 200 });
+ },
+});