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

@takibi/cloudflare-tracing

v0.1.8

Published

Cloudflare Workers native tracing adapter for takibi.

Readme

@takibi/cloudflare-tracing

Adapts Cloudflare Workers native tracing to Takibi's tracer contract so Takibi spans nest in the Workers dashboard next to platform operations.

This package does not use the OpenTelemetry API. For OTLP export, use @takibi/opentelemetry instead. Do not enable both adapters in the same isolate; they share Takibi's process-local tracer registry.

pnpm add takibi @takibi/cloudflare-tracing

Enable Workers tracing. enterSpan needs a current compatibility_date. This adapter does not import Node.js APIs and does not need nodejs_compat or nodejs_als. Parentage uses Workers native async context.

{
  "compatibility_date": "2026-08-18",
  "observability": {
    "traces": {
      "enabled": true,
    },
  },
}

Call enable() once per isolate with the runtime tracing object. Flush stays with Cloudflare; there is no provider to waitUntil.

import { tracing } from "cloudflare:workers";
import { createTakibi, fullAccess } from "takibi";
import { CloudflareTakibiInstrumentation } from "@takibi/cloudflare-tracing";
import { z } from "zod";

new CloudflareTakibiInstrumentation().enable(tracing);

declare const tenantStore: DurableObjectNamespace;

const app = createTakibi()({
  resolve: () => ({ tenantId: "demo" }),
  stub: ({ resolved }) => tenantStore.getByName(resolved.tenantId),
})
  .defineCollections({
    posts: {
      schema: z.object({ title: z.string() }),
      accessPolicy: fullAccess,
    },
  })
  .actions({});

export default {
  fetch(request: Request): Promise<Response> {
    return app.fetch(request);
  },
};

Call enable(tracing) in every isolate that should emit Takibi spans, including Durable Object classes. import { tracing } from "cloudflare:workers" works outside the handler.

Mapping

Span names, kinds, and takibi.* attributes are selected by Takibi core. This package maps them onto tracing.enterSpan():

  • Each Takibi withSpan becomes one enterSpan. The native span stays active until the callback's returned promise settles, so nested Takibi spans and platform fetch / KV work nest correctly.
  • span.kind is recorded as the span.kind attribute. Workers has no separate span-kind field.
  • Exceptions become error.type, error.message, and error.stack. Status becomes otel.status_code and otel.status_description. Workers does not yet expose setOutcome.
  • inject / extract are no-ops. Workers already propagates native context across Durable Object fetches. Cloudflare does not yet expose spanContext() for W3C traceparent.
  • Synthetic Takibi span IDs are local to each startSpan call. Cloudflare parentage is the enterSpan async context, not those IDs.

Use the typed TAKIBI_SPAN and TAKIBI_ATTR constants from takibi/instrumentation when dashboards need these stable names. createCloudflareTakibiTracer(tracing) is the same adapter without registering the process-local backend; tests and custom context wiring can call it directly.

Do not wrap Takibi in registerInstrumentations(). Use CloudflareTakibiInstrumentation directly.