mirror of
https://github.com/denoland/deno.git
synced 2025-03-12 07:07:43 -04:00

When calling `setActiveSpan` at the module root, or with `options.root = true`, the function would internally throw.
12 lines
314 B
TypeScript
12 lines
314 B
TypeScript
// Copyright 2018-2025 the Deno authors. MIT license.
|
|
|
|
import { trace } from "npm:@opentelemetry/api@1.9.0";
|
|
|
|
const tracer = trace.getTracer("example-tracer");
|
|
|
|
tracer.startActiveSpan("top level span", (span) => {
|
|
span.end();
|
|
});
|
|
tracer.startActiveSpan("root span", { root: true }, (span) => {
|
|
span.end();
|
|
});
|