A Deno-oriented build of opentelemetry-js, with extra Deno-specific integrations.
- Published on JSR since
v0.10.0
. - Previous versions were published to
/x/
.
// set up the SDK:
import 'jsr:@cloudydeno/opentelemetry/register';
// Can also use `deno --unstable-otel` instead of the /register import.
// See more setup in the deno documentation on OTel (short for opentelemetry)
// Wrap an async function in a span:
import { traceAsyncFunc } from 'jsr:@cloudydeno/opentelemetry/instrumentation/async.ts';
const doTheThing = traceAsyncFunction('DoTheThing', async () => {
const resp = await fetch(...);
/* ... */
});
await doTheThing();