npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@aotoki/edge-otel

v0.2.0

Published

Lightweight OpenTelemetry SDK for V8 isolate edge runtimes

Readme

@aotoki/edge-otel

Tests codecov

Lightweight OpenTelemetry SDK for V8 isolate edge runtimes (Cloudflare Workers, Vercel Edge Functions, Deno Deploy).

The standard @opentelemetry/sdk-node depends on node:perf_hooks, node:async_hooks, and node:http, which are absent or broken in V8 isolate runtimes. This package provides a correct OTel span exporter and tracer provider that works in these environments using only Web Platform APIs (fetch, btoa) — no Node.js built-ins required.

Features

  • OTLP/HTTP JSON exporter — exports spans to any OTLP-compatible collector (Langfuse, Grafana Tempo, Honeycomb, Jaeger, etc.)
  • SimpleSpanProcessor — per-span buffering with explicit flush, no background timers
  • Context propagationAsyncLocalStorage-based trace grouping across multiple AI SDK calls
  • Langfuse preset — pre-configured exporter for Langfuse backend
  • Manual spans — standard OTel Tracer API for custom instrumentation (RAG, DB queries, etc.)
  • Streaming support — defer flush until the stream is fully consumed

Install

pnpm add @aotoki/edge-otel

Quick Start

Cloudflare Workers

import { createTracerProvider } from "@aotoki/edge-otel";

const provider = createTracerProvider({
  endpoint: "https://your-collector.example.com/v1/traces",
  headers: {
    Authorization: "Bearer your-token",
  },
});

const tracer = provider.getTracer("ai");

// Use tracer with AI SDK
const result = await generateText({
  model: openai("gpt-4o"),
  prompt: "Hello!",
  experimental_telemetry: {
    isEnabled: true,
    tracer,
  },
});

// Flush spans before the isolate exits
ctx.waitUntil(provider.forceFlush());

Manual Spans

const tracer = provider.getTracer("ai");

// Custom spans appear alongside AI SDK spans in the same trace
const docs = await tracer.startActiveSpan("rag.retrieve", async (span) => {
  try {
    const results = await vectorStore.similaritySearch(query, 5);
    span.setAttribute("rag.result_count", results.length);
    return results;
  } finally {
    span.end();
  }
});

const result = await generateText({
  model: openai("gpt-4o"),
  prompt: buildPrompt(docs),
  experimental_telemetry: { isEnabled: true, tracer },
});

API

createTracerProvider(options): TracerProvider

Creates a tracer provider wired with SimpleSpanProcessor and OtlpHttpJsonExporter. Options include endpoint, headers, serviceName, and resourceAttributes. Returns a provider with getTracer(scopeName) and forceFlush().

import { createTracerProvider } from "@aotoki/edge-otel";

langfuseExporter(options): LangfuseExporterConfig

Constructs exporter configuration for Langfuse. Spread the result into createTracerProvider. Accepts publicKey, secretKey, and optional baseUrl, environment, release.

import { langfuseExporter } from "@aotoki/edge-otel/exporters/langfuse";

OtlpHttpJsonExporter

Exported for advanced use cases (e.g., multiple backends, custom span processors).

import { OtlpHttpJsonExporter } from "@aotoki/edge-otel";

Requirements

  • Cloudflare Workers: nodejs_compat compatibility flag required for multi-call trace grouping via AsyncLocalStorage
  • Single AI SDK call per request: No compatibility flag needed

Documentation

For detailed specifications and design rationale:

Contributing

pnpm install        # Install dependencies
pnpm test           # Run tests
pnpm lint           # Lint
pnpm format:check   # Check formatting

License

Apache-2.0