Skip to main content

Send Telemetry to Honeycomb from WebAssembly in Deno

Observability in Honeycomb from WebAssembly


Enables the extraction of traces/spans from Wasm modules executing in a Deno environment and emits them to


Deno will install the package if it detects that you've imported it in your source code. See the example below.


A basic Typescript program that loads a Wasm module and executes it using the native WebAssembly runtime.

import honeycomb from "npm:@dylibso/observe-sdk-honeycomb";
const {
} = honeycomb;

import Context from "";
import { load } from "";

// setup some confgiruation and create a new instance of the Honeycomb adapter
const env = await load();
const apiKey = env["HONEYCOMB_API_KEY"];

const config: HoneycombConfig = {
apiKey: apiKey,
dataset: "deno",
emitTracesInterval: 1000,
traceBatchMax: 100,
host: "",
const adapter = new HoneycombAdapter(config);

// load up a Wasm module
const bytes = await Deno.readFile("your_module.wasm");

// create an optional filter that instructs the adapter to throw away any
// spans below a configured threshold
const opts = {
spanFilter: {
minDurationMicroseconds: 100,

// start the adapter with the Wasm module bytes and options
const traceContext = await adapter.start(bytes, opts);

// load, instantiate and run the Wasm module
const module = new WebAssembly.Module(bytes);
const runtime = new Context({
stdin: Deno.stdin.rid,
stdout: Deno.stdout.rid,
const instance = new WebAssembly.Instance(
"wasi_snapshot_preview1": runtime.exports,

// instruct the adapter to stop the trace

Adapter Configuration

You may modify the behavior of your adapter by passing in a configuration when initializing the adapter. A configuration has the following fields:

const config = {
// the URL of your OpenTelemetry collector
host: "",
// your Honeycomb API key
// the dataset to group your observability data under
dataset: "deno",
// how often to send new traces
emitTracesInterval: 1000,
// the maximum number of traces to send per request
traceBatchMax: 100,
const adapter = new HoneycombAdapter(config);